mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge pull request #880 from halkyon/fulltextsearch_text
ContentControllerSearchExtensionTest doesn't clean up after itself.
This commit is contained in:
commit
27c8122123
@ -1,9 +1,7 @@
|
||||
<?php
|
||||
class ContentControllerSearchExtensionTest extends SapphireTest {
|
||||
|
||||
|
||||
public function testCustomSearchFormClassesToTest() {
|
||||
FulltextSearchable::enable('File');
|
||||
|
||||
$page = new Page();
|
||||
$page->URLSegment = 'whatever';
|
||||
$page->Content = 'oh really?';
|
||||
@ -14,4 +12,23 @@ class ContentControllerSearchExtensionTest extends SapphireTest {
|
||||
|
||||
if (get_class($form) == 'SearchForm') $this->assertEquals(array('File'), $form->getClassesToSearch());
|
||||
}
|
||||
|
||||
public function setUpOnce() {
|
||||
parent::setUpOnce();
|
||||
|
||||
FulltextSearchable::enable('File');
|
||||
}
|
||||
|
||||
/**
|
||||
* FulltextSearchable::enable() leaves behind remains that don't get cleaned up
|
||||
* properly at the end of the test. This becomes apparent when a later test tries to
|
||||
* ALTER TABLE File and add fulltext indexes with the InnoDB table type.
|
||||
*/
|
||||
public function tearDownOnce() {
|
||||
parent::tearDownOnce();
|
||||
|
||||
Config::inst()->update('File', 'create_table_options', array('MySQLDatabase' => 'ENGINE=InnoDB'));
|
||||
File::remove_extension('FulltextSearchable');
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user