Remove unused skipRedirect param
[civicrm-core.git] / tests / phpunit / CRM / Extension / MapperTest.php
index 748d6ab16e90c186785f1b0ab4faea30c39099bd..bbe4aeed1e88898e0b85e3b2a09979b486fe8e8b 100644 (file)
@@ -9,17 +9,32 @@ class CRM_Extension_MapperTest extends CiviUnitTestCase {
   /**
    * @var string
    */
-  protected $basedir, $basedir2;
+  protected $basedir;
+
+  /**
+   * @var string
+   */
+  protected $basedir2;
+
+  /**
+   * @var CRM_Extension_Container_Interface
+   */
+  protected $container;
 
   /**
    * @var CRM_Extension_Container_Interface
    */
-  protected $container, $containerWithSlash;
+  protected $containerWithSlash;
+
+  /**
+   * @var CRM_Extension_Mapper
+   */
+  protected $mapper;
 
   /**
    * @var CRM_Extension_Mapper
    */
-  protected $mapper, $mapperWithSlash;
+  protected $mapperWithSlash;
 
   public function setUp() {
     parent::setUp();
@@ -89,23 +104,23 @@ class CRM_Extension_MapperTest extends CiviUnitTestCase {
   }
 
   public function testGetKeysByPath() {
-    $mappers = array(
+    $mappers = [
       $this->basedir => $this->mapper,
       $this->basedir2 => $this->mapperWithSlash,
-    );
+    ];
     foreach ($mappers as $basedir => $mapper) {
       /** @var CRM_Extension_Mapper $mapper */
-      $this->assertEquals(array(), $mapper->getKeysByPath($basedir));
-      $this->assertEquals(array(), $mapper->getKeysByPath($basedir . '/weird'));
-      $this->assertEquals(array(), $mapper->getKeysByPath($basedir . '/weird/'));
-      $this->assertEquals(array(), $mapper->getKeysByPath($basedir . '/weird//'));
-      $this->assertEquals(array('test.foo.bar'), $mapper->getKeysByPath($basedir . '/*'));
-      $this->assertEquals(array('test.foo.bar'), $mapper->getKeysByPath($basedir . '//*'));
-      $this->assertEquals(array('test.foo.bar'), $mapper->getKeysByPath($basedir . '/weird/*'));
-      $this->assertEquals(array('test.foo.bar'), $mapper->getKeysByPath($basedir . '/weird/foobar'));
-      $this->assertEquals(array('test.foo.bar'), $mapper->getKeysByPath($basedir . '/weird/foobar/'));
-      $this->assertEquals(array('test.foo.bar'), $mapper->getKeysByPath($basedir . '/weird/foobar//'));
-      $this->assertEquals(array('test.foo.bar'), $mapper->getKeysByPath($basedir . '/weird/foobar/*'));
+      $this->assertEquals([], $mapper->getKeysByPath($basedir));
+      $this->assertEquals([], $mapper->getKeysByPath($basedir . '/weird'));
+      $this->assertEquals([], $mapper->getKeysByPath($basedir . '/weird/'));
+      $this->assertEquals([], $mapper->getKeysByPath($basedir . '/weird//'));
+      $this->assertEquals(['test.foo.bar'], $mapper->getKeysByPath($basedir . '/*'));
+      $this->assertEquals(['test.foo.bar'], $mapper->getKeysByPath($basedir . '//*'));
+      $this->assertEquals(['test.foo.bar'], $mapper->getKeysByPath($basedir . '/weird/*'));
+      $this->assertEquals(['test.foo.bar'], $mapper->getKeysByPath($basedir . '/weird/foobar'));
+      $this->assertEquals(['test.foo.bar'], $mapper->getKeysByPath($basedir . '/weird/foobar/'));
+      $this->assertEquals(['test.foo.bar'], $mapper->getKeysByPath($basedir . '/weird/foobar//'));
+      $this->assertEquals(['test.foo.bar'], $mapper->getKeysByPath($basedir . '/weird/foobar/*'));
     }
   }
 
@@ -131,7 +146,7 @@ class CRM_Extension_MapperTest extends CiviUnitTestCase {
     file_put_contents("$basedir/weird/foobar/info.xml", "<extension key='test.foo.bar' type='report'><file>oddball</file></extension>");
     // not needed for now // file_put_contents("$basedir/weird/bar/oddball.php", "<?php\n");
     $c = new CRM_Extension_Container_Basic($basedir . $appendPathGarbage, 'http://example/basedir' . $appendPathGarbage, $cache, $cacheKey);
-    return array($basedir, $c);
+    return [$basedir, $c];
   }
 
 }