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 {
|
|
|
|
|
|
|
|
function setUp() {
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
$this->orig['File_searchable'] = Object::has_extension('File', 'FulltextSearchable');
|
|
|
|
|
|
|
|
// TODO This shouldn't need all arguments included
|
|
|
|
Object::remove_extension('File', 'FulltextSearchable(\'Filename,Title,Content\')');
|
|
|
|
}
|
|
|
|
|
|
|
|
function tearDown() {
|
|
|
|
// TODO This shouldn't need all arguments included
|
|
|
|
if($this->orig['File_searchable']) Object::add_extension('File', 'FulltextSearchable(\'Filename,Title,Content\')');
|
|
|
|
|
|
|
|
parent::tearDown();
|
|
|
|
}
|
|
|
|
|
|
|
|
function testEnable() {
|
|
|
|
FulltextSearchable::enable();
|
|
|
|
$this->assertTrue(Object::has_extension('File', 'FulltextSearchable'));
|
|
|
|
}
|
|
|
|
|
|
|
|
function testEnableWithCustomClasses() {
|
2011-03-23 04:11:34 +01:00
|
|
|
FulltextSearchable::enable(array('File'));
|
|
|
|
$this->assertTrue(Object::has_extension('File', 'FulltextSearchable'));
|
2010-10-19 06:53:36 +02:00
|
|
|
|
|
|
|
// TODO This shouldn't need all arguments included
|
|
|
|
Object::remove_extension('File', 'FulltextSearchable(\'Filename,Title,Content\')');
|
|
|
|
|
|
|
|
$this->assertFalse(Object::has_extension('File', 'FulltextSearchable'));
|
|
|
|
}
|
|
|
|
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|