mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-06 01:31:22 +02:00
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit. This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
43 lines
1.2 KiB
PHP
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(\'"Title","Filename","Content"\')');
|
|
|
|
$this->assertFalse(Object::has_extension('File', 'FulltextSearchable'));
|
|
}
|
|
|
|
}
|