2010-10-19 06:53:36 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2012-04-12 08:02:46 +02:00
|
|
|
* @package framework
|
2010-10-19 06:53:36 +02:00
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
|
|
|
|
class FulltextSearchableTest extends SapphireTest {
|
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function setUp() {
|
2010-10-19 06:53:36 +02:00
|
|
|
parent::setUp();
|
|
|
|
|
2012-10-09 23:59:23 +02:00
|
|
|
$this->orig['File_searchable'] = File::has_extension('FulltextSearchable');
|
2010-10-19 06:53:36 +02:00
|
|
|
|
|
|
|
// TODO This shouldn't need all arguments included
|
2012-10-09 23:30:40 +02:00
|
|
|
File::remove_extension('FulltextSearchable(\'"Filename","Title","Content"\')');
|
2010-10-19 06:53:36 +02:00
|
|
|
}
|
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function tearDown() {
|
2010-10-19 06:53:36 +02:00
|
|
|
// TODO This shouldn't need all arguments included
|
2012-09-26 23:34:00 +02:00
|
|
|
if($this->orig['File_searchable']) {
|
2012-10-09 05:55:37 +02:00
|
|
|
File::add_extension('FulltextSearchable(\'"Filename","Title","Content"\')');
|
2012-09-26 23:34:00 +02:00
|
|
|
}
|
2010-10-19 06:53:36 +02:00
|
|
|
|
|
|
|
parent::tearDown();
|
|
|
|
}
|
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function testEnable() {
|
2010-10-19 06:53:36 +02:00
|
|
|
FulltextSearchable::enable();
|
2012-10-09 23:59:23 +02:00
|
|
|
$this->assertTrue(File::has_extension('FulltextSearchable'));
|
2010-10-19 06:53:36 +02:00
|
|
|
}
|
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function testEnableWithCustomClasses() {
|
2011-03-23 04:11:34 +01:00
|
|
|
FulltextSearchable::enable(array('File'));
|
2012-10-09 23:59:23 +02:00
|
|
|
$this->assertTrue(File::has_extension('FulltextSearchable'));
|
2010-10-19 06:53:36 +02:00
|
|
|
|
|
|
|
// TODO This shouldn't need all arguments included
|
2012-10-09 23:59:23 +02:00
|
|
|
File::remove_extension('FulltextSearchable(\'"Filename","Title","Content"\')');
|
2010-10-19 06:53:36 +02:00
|
|
|
|
2012-10-09 23:59:23 +02:00
|
|
|
$this->assertFalse(File::has_extension('File', 'FulltextSearchable'));
|
2010-10-19 06:53:36 +02:00
|
|
|
}
|
|
|
|
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|