mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Removing SiteTree dependency from FulltextSearchableTest
This commit is contained in:
parent
3f3f0f6211
commit
b78b1309c9
@ -10,30 +10,26 @@ class FulltextSearchableTest extends SapphireTest {
|
||||
parent::setUp();
|
||||
|
||||
$this->orig['File_searchable'] = Object::has_extension('File', 'FulltextSearchable');
|
||||
$this->orig['SiteTree_searchable'] = Object::has_extension('SiteTree', 'FulltextSearchable');
|
||||
|
||||
// TODO This shouldn't need all arguments included
|
||||
Object::remove_extension('File', 'FulltextSearchable(\'Filename,Title,Content\')');
|
||||
Object::remove_extension('SiteTree', 'FulltextSearchable(\'Title,MenuTitle,Content,MetaTitle,MetaDescription,MetaKeywords\')');
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
// TODO This shouldn't need all arguments included
|
||||
if($this->orig['File_searchable']) Object::add_extension('File', 'FulltextSearchable(\'Filename,Title,Content\')');
|
||||
if($this->orig['SiteTree_searchable']) Object::add_extension('SiteTree', 'FulltextSearchable(\'Title,MenuTitle,Content,MetaTitle,MetaDescription,MetaKeywords\')');
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
function testEnable() {
|
||||
FulltextSearchable::enable();
|
||||
$this->assertTrue(Object::has_extension('SiteTree', 'FulltextSearchable'));
|
||||
$this->assertTrue(Object::has_extension('File', 'FulltextSearchable'));
|
||||
}
|
||||
|
||||
function testEnableWithCustomClasses() {
|
||||
FulltextSearchable::enable(array('SiteTree'));
|
||||
$this->assertTrue(Object::has_extension('SiteTree', 'FulltextSearchable'));
|
||||
FulltextSearchable::enable(array('File'));
|
||||
$this->assertTrue(Object::has_extension('File', 'FulltextSearchable'));
|
||||
|
||||
// TODO This shouldn't need all arguments included
|
||||
Object::remove_extension('File', 'FulltextSearchable(\'Filename,Title,Content\')');
|
||||
|
Loading…
Reference in New Issue
Block a user