silverstripe-framework/tests/search/FulltextSearchableTest.php
Ingo Schommer 56f7ce1dcf Merge remote-tracking branch 'origin/3.0'
Conflicts:
	control/Cookie.php
	control/Director.php
	control/HTTPResponse.php
	model/Database.php
	model/MySQLDatabase.php
	model/SQLQuery.php
	view/Requirements.php
	view/SSViewer.php
2012-10-03 16:16:19 +02:00

43 lines
1.2 KiB
PHP

<?php
/**
* @package framework
* @subpackage tests
*/
class FulltextSearchableTest extends SapphireTest {
public 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"\')');
}
public 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();
}
public function testEnable() {
FulltextSearchable::enable();
$this->assertTrue(Object::has_extension('File', 'FulltextSearchable'));
}
public function testEnableWithCustomClasses() {
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"\')');
$this->assertFalse(Object::has_extension('File', 'FulltextSearchable'));
}
}