Merge pull request #17284 from agh1/admin-console-only
[civicrm-core.git] / tests / phpunit / CRM / Core / InnoDBIndexerTest.php
index 60470e2ffd935b7fc7bf134b99b7a8280bfdd737..8ec73a16a86fd80f07346a095a544ded57da221a 100644 (file)
@@ -10,46 +10,46 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase {
     // 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.
-    $idx = new CRM_Core_InnoDBIndexer(FALSE, array());
+    $idx = new CRM_Core_InnoDBIndexer(FALSE, []);
     $idx->fixSchemaDifferences();
 
     parent::tearDown();
   }
 
   public function testHasDeclaredIndex() {
-    $idx = new CRM_Core_InnoDBIndexer(TRUE, array(
-      'civicrm_contact' => array(
-        array('first_name', 'last_name'),
-        array('foo'),
-      ),
-      'civicrm_email' => array(
-        array('whiz'),
-      ),
-    ));
+    $idx = new CRM_Core_InnoDBIndexer(TRUE, [
+      'civicrm_contact' => [
+        ['first_name', 'last_name'],
+        ['foo'],
+      ],
+      'civicrm_email' => [
+        ['whiz'],
+      ],
+    ]);
 
-    $this->assertTrue($idx->hasDeclaredIndex('civicrm_contact', array('first_name', 'last_name')));
-    $this->assertTrue($idx->hasDeclaredIndex('civicrm_contact', array('last_name', 'first_name')));
+    $this->assertTrue($idx->hasDeclaredIndex('civicrm_contact', ['first_name', 'last_name']));
+    $this->assertTrue($idx->hasDeclaredIndex('civicrm_contact', ['last_name', 'first_name']));
     // not sure if this is right behavior
-    $this->assertTrue($idx->hasDeclaredIndex('civicrm_contact', array('first_name')));
+    $this->assertTrue($idx->hasDeclaredIndex('civicrm_contact', ['first_name']));
     // not sure if this is right behavior
-    $this->assertTrue($idx->hasDeclaredIndex('civicrm_contact', array('last_name')));
-    $this->assertTrue($idx->hasDeclaredIndex('civicrm_contact', array('foo')));
-    $this->assertFalse($idx->hasDeclaredIndex('civicrm_contact', array('whiz')));
+    $this->assertTrue($idx->hasDeclaredIndex('civicrm_contact', ['last_name']));
+    $this->assertTrue($idx->hasDeclaredIndex('civicrm_contact', ['foo']));
+    $this->assertFalse($idx->hasDeclaredIndex('civicrm_contact', ['whiz']));
 
-    $this->assertFalse($idx->hasDeclaredIndex('civicrm_email', array('first_name', 'last_name')));
-    $this->assertFalse($idx->hasDeclaredIndex('civicrm_email', array('foo')));
-    $this->assertTrue($idx->hasDeclaredIndex('civicrm_email', array('whiz')));
+    $this->assertFalse($idx->hasDeclaredIndex('civicrm_email', ['first_name', 'last_name']));
+    $this->assertFalse($idx->hasDeclaredIndex('civicrm_email', ['foo']));
+    $this->assertTrue($idx->hasDeclaredIndex('civicrm_email', ['whiz']));
   }
 
   /**
    * When disabled, there is no FTS index, so queries that rely on FTS index fail.
    */
   public function testDisabled() {
-    $idx = new CRM_Core_InnoDBIndexer(FALSE, array(
-      'civicrm_contact' => array(
-        array('first_name', 'last_name'),
-      ),
-    ));
+    $idx = new CRM_Core_InnoDBIndexer(FALSE, [
+      'civicrm_contact' => [
+        ['first_name', 'last_name'],
+      ],
+    ]);
     $idx->fixSchemaDifferences();
 
     try {
@@ -70,11 +70,11 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase {
       return;
     }
 
-    $idx = new CRM_Core_InnoDBIndexer(TRUE, array(
-      'civicrm_contact' => array(
-        array('first_name', 'last_name'),
-      ),
-    ));
+    $idx = new CRM_Core_InnoDBIndexer(TRUE, [
+      'civicrm_contact' => [
+        ['first_name', 'last_name'],
+      ],
+    ]);
     $idx->fixSchemaDifferences();
 
     CRM_Core_DAO::executeQuery('SELECT id FROM civicrm_contact WHERE MATCH(first_name,last_name) AGAINST ("joe")');