X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCRM%2FCore%2FInnoDBIndexerTest.php;h=8db28afb1bd8f074527ddcc858edd34fac7157c7;hb=649d6dd08539215332dc943a749af302a42f76ef;hp=4d340a2e6ee4623fe8b597d7fc9cb255839b2541;hpb=1789c269b1c68178c1f3de38d751a4e37f94db4c;p=civicrm-core.git diff --git a/tests/phpunit/CRM/Core/InnoDBIndexerTest.php b/tests/phpunit/CRM/Core/InnoDBIndexerTest.php index 4d340a2e6e..8db28afb1b 100644 --- a/tests/phpunit/CRM/Core/InnoDBIndexerTest.php +++ b/tests/phpunit/CRM/Core/InnoDBIndexerTest.php @@ -6,7 +6,7 @@ require_once 'CiviTest/CiviUnitTestCase.php'; * Class CRM_Core_InnoDBIndexerTest */ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { - function tearDown() { + public function tearDown() { // May or may not cleanup well if there's a bug in the indexer. // This is better than nothing -- and better than duplicating the // cleanup logic. @@ -16,11 +16,11 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { parent::tearDown(); } - function testHasDeclaredIndex() { + public function testHasDeclaredIndex() { $idx = new CRM_Core_InnoDBIndexer(TRUE, array( 'civicrm_contact' => array( array('first_name', 'last_name'), - array('foo') + array('foo'), ), 'civicrm_email' => array( array('whiz'), @@ -42,7 +42,7 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { /** * When disabled, there is no FTS index, so queries that rely on FTS index fail. */ - function testDisabled() { + public function testDisabled() { $idx = new CRM_Core_InnoDBIndexer(FALSE, array( 'civicrm_contact' => array( array('first_name', 'last_name'), @@ -53,7 +53,8 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { try { CRM_Core_DAO::executeQuery('SELECT id FROM civicrm_contact WHERE MATCH(first_name,last_name) AGAINST ("joe")'); $this->fail("Missed expected exception"); - } catch (Exception $e) { + } + catch (Exception $e) { $this->assertTrue(TRUE, 'Received expected exception'); } } @@ -61,7 +62,7 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { /** * When enabled, the FTS index is created, so queries that rely on FTS work. */ - function testEnabled() { + public function testEnabled() { if (!$this->supportsFts()) { $this->markTestSkipped("Local installation of InnoDB does not support FTS."); return; @@ -77,7 +78,11 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { CRM_Core_DAO::executeQuery('SELECT id FROM civicrm_contact WHERE MATCH(first_name,last_name) AGAINST ("joe")'); } - function supportsFts() { + /** + * @return mixed + */ + public function supportsFts() { return version_compare(CRM_Core_DAO::singleValueQuery('SELECT VERSION()'), '5.6.0', '>='); } + }