diff --git a/core/modules/tour/tests/src/Functional/TourTest.php b/core/modules/tour/tests/src/Functional/TourTest.php index f500183..933055b 100644 --- a/core/modules/tour/tests/src/Functional/TourTest.php +++ b/core/modules/tour/tests/src/Functional/TourTest.php @@ -26,7 +26,7 @@ class TourTest extends TourTestBasic { * @var array * A list of permissions. */ - protected $permissions = ['access tour', 'administer languages']; + protected $permissions = array('access tour', 'administer languages'); /** * Tour tip attributes to be tested. Keyed by the path. @@ -34,9 +34,8 @@ class TourTest extends TourTestBasic { * @var array * An array of tip attributes, keyed by path. */ - protected $tips = array( - 'tour-test-1' => array(), + 'tour-test-1' => array(), ); /** @@ -68,7 +67,7 @@ public function testTourFunctionality() { $elements = $this->xpath('//li[@data-id=:data_id and @class=:classes and ./p//a[@href=:href and contains(., :text)]]', [ ':classes' => 'tip-module-tour-test tip-type-text tip-tour-test-1', ':data_id' => 'tour-test-1', - ':href' => Url::fromRoute('', [], ['absolute' => TRUE])->toString(), + ':href' => Url::fromRoute('', array(), array('absolute' => TRUE))->toString(), ':text' => 'Drupal', ]); $this->assertEquals(count($elements), 1, 'Found Token replacement.'); @@ -106,43 +105,43 @@ public function testTourFunctionality() { $this->assertNotEquals(count($elements), 1, 'Did not find English variant of tip 1.'); // Programmatically create a tour for use through the remainder of the test. - $tour = Tour::create([ + $tour = Tour::create(array( 'id' => 'tour-entity-create-test-en', 'label' => 'Tour test english', 'langcode' => 'en', 'module' => 'system', - 'routes' => [ - ['route_name' => 'tour_test.1'], - ], - 'tips' => [ - 'tour-test-1' => [ + 'routes' => array( + array('route_name' => 'tour_test.1'), + ), + 'tips' => array( + 'tour-test-1' => array( 'id' => 'tour-code-test-1', 'plugin' => 'text', 'label' => 'The rain in spain', 'body' => 'Falls mostly on the plain.', 'weight' => '100', - 'attributes' => [ + 'attributes' => array( 'data-id' => 'tour-code-test-1', - ], - ], - 'tour-code-test-2' => [ + ), + ), + 'tour-code-test-2' => array( 'id' => 'tour-code-test-2', 'plugin' => 'image', 'label' => 'The awesome image', 'url' => 'http://local/image.png', 'weight' => 1, - 'attributes' => [ + 'attributes' => array( 'data-id' => 'tour-code-test-2' - ], - ], - ], - ]); + ), + ), + ), + )); $tour->save(); // Ensure that a tour entity has the expected dependencies based on plugin // providers and the module named in the configuration entity. $dependencies = $tour->calculateDependencies()->getDependencies(); - $this->assertEquals($dependencies['module'], ['system', 'tour_test']); + $this->assertEquals($dependencies['module'], array('system', 'tour_test')); $this->drupalGet('tour-test-1'); diff --git a/core/modules/tour/tests/src/Functional/TourTestBase.php b/core/modules/tour/tests/src/Functional/TourTestBase.php index c51a115..7011ae1 100644 --- a/core/modules/tour/tests/src/Functional/TourTestBase.php +++ b/core/modules/tour/tests/src/Functional/TourTestBase.php @@ -29,7 +29,7 @@ * $this->assertTourTips($tips); * @endcode */ - protected function assertTourTips($tips = []) { + public function assertTourTips($tips = array()) { // Get the rendered tips and their data-id and data-class attributes. if (empty($tips)) { // Tips are rendered as
  • elements inside
      . diff --git a/core/modules/tour/tests/src/Functional/TourTestBasic.php b/core/modules/tour/tests/src/Functional/TourTestBasic.php index 2ed93a7..ec92987 100644 --- a/core/modules/tour/tests/src/Functional/TourTestBasic.php +++ b/core/modules/tour/tests/src/Functional/TourTestBasic.php @@ -14,12 +14,12 @@ * An array of tip attributes, keyed by path. * * @code - * protected $tips = [ - * '/foo/bar' => [ - * ['data-id' => 'foo'], - * ['data-class' => 'bar'], - * ], - * ]; + * protected $tips = array( + * '/foo/bar' => array( + * array('data-id' => 'foo'), + * array('data-class' => 'bar'), + * ), + * ); * @endcode */ protected $tips = array(); @@ -37,14 +37,14 @@ * @var array * A list of permissions. */ - protected $permissions = ['access tour']; + protected $permissions = array('access tour'); protected function setUp() { parent::setUp(); - // Make sure we are using distinct default and administrative themes for the - // duration of these tests. - $this->container->get('theme_handler')->install(['bartik', 'seven']); + // Make sure we are using distinct default and administrative themes for + // the duration of these tests. + $this->container->get('theme_handler')->install(array('bartik', 'seven')); $this->config('system.theme') ->set('default', 'bartik') ->set('admin', 'seven') diff --git a/core/modules/tour/tests/src/Kernel/TourPluginTest.php b/core/modules/tour/tests/src/Kernel/TourPluginTest.php index 835c8b6..27a7310 100644 --- a/core/modules/tour/tests/src/Kernel/TourPluginTest.php +++ b/core/modules/tour/tests/src/Kernel/TourPluginTest.php @@ -16,7 +16,7 @@ class TourPluginTest extends KernelTestBase { * * @var array */ - public static $modules = ['tour']; + public static $modules = array('tour'); /** * Stores the tour plugin manager. @@ -28,7 +28,7 @@ class TourPluginTest extends KernelTestBase { protected function setUp() { parent::setUp(); - $this->installConfig(['tour']); + $this->installConfig(array('tour')); $this->pluginManager = $this->container->get('plugin.manager.tour.tip'); } diff --git a/core/modules/tour/tests/src/Unit/Entity/TourTest.php b/core/modules/tour/tests/src/Unit/Entity/TourTest.php index de847bc..2c71aa9 100644 --- a/core/modules/tour/tests/src/Unit/Entity/TourTest.php +++ b/core/modules/tour/tests/src/Unit/Entity/TourTest.php @@ -29,7 +29,7 @@ class TourTest extends UnitTestCase { public function testHasMatchingRoute($routes, $route_name, $route_params, $result) { $tour = $this->getMockBuilder('\Drupal\tour\Entity\Tour') ->disableOriginalConstructor() - ->setMethods(['getRoutes']) + ->setMethods(array('getRoutes')) ->getMock(); $tour->expects($this->any()) @@ -45,94 +45,94 @@ public function testHasMatchingRoute($routes, $route_name, $route_params, $resul * Provides sample routes for testing. */ public function routeProvider() { - return [ + return array( // Simple match. - [ - [ - ['route_name' => 'some.route'], - ], + array( + array( + array('route_name' => 'some.route'), + ), 'some.route', array(), TRUE, - ], + ), // Simple non-match. - [ - [ - ['route_name' => 'another.route'], - ], + array( + array( + array('route_name' => 'another.route'), + ), 'some.route', array(), FALSE, - ], + ), // Empty params. - [ - [ - [ + array( + array( + array( 'route_name' => 'some.route', - 'route_params' => ['foo' => 'bar'], - ], - ], + 'route_params' => array('foo' => 'bar'), + ), + ), 'some.route', array(), FALSE, - ], + ), // Match on params. - [ - [ - [ + array( + array( + array( 'route_name' => 'some.route', - 'route_params' => ['foo' => 'bar'], - ], - ], + 'route_params' => array('foo' => 'bar'), + ), + ), 'some.route', - ['foo' => 'bar'], + array('foo' => 'bar'), TRUE, - ], + ), // Non-matching params. - [ - [ - [ + array( + array( + array( 'route_name' => 'some.route', - 'route_params' => ['foo' => 'bar'], - ], - ], + 'route_params' => array('foo' => 'bar'), + ), + ), 'some.route', - ['bar' => 'foo'], + array('bar' => 'foo'), FALSE, - ], + ), // One matching, one not. - [ - [ - [ + array( + array( + array( 'route_name' => 'some.route', - 'route_params' => ['foo' => 'bar'], - ], - [ + 'route_params' => array('foo' => 'bar'), + ), + array( 'route_name' => 'some.route', - 'route_params' => ['bar' => 'foo'], - ], - ], + 'route_params' => array('bar' => 'foo'), + ), + ), 'some.route', - ['bar' => 'foo'], + array('bar' => 'foo'), TRUE, - ], + ), // One matching, one not. - [ - [ - [ + array( + array( + array( 'route_name' => 'some.route', - 'route_params' => ['foo' => 'bar'], - ], - [ + 'route_params' => array('foo' => 'bar'), + ), + array( 'route_name' => 'some.route', - 'route_params' => ['foo' => 'baz'], - ], - ], + 'route_params' => array('foo' => 'baz'), + ), + ), 'some.route', - ['foo' => 'baz'], + array('foo' => 'baz'), TRUE, - ], - ]; + ), + ); } } diff --git a/core/modules/tour/tests/tour_test/src/Controller/TourTestController.php b/core/modules/tour/tests/tour_test/src/Controller/TourTestController.php index 56505aa..87b817d 100644 --- a/core/modules/tour/tests/tour_test/src/Controller/TourTestController.php +++ b/core/modules/tour/tests/tour_test/src/Controller/TourTestController.php @@ -18,56 +18,56 @@ class TourTestController { * Array of markup. */ public function tourTest1($locale = 'foo') { - return [ - 'tip-1' => [ + return array( + 'tip-1' => array( '#type' => 'container', - '#attributes' => [ + '#attributes' => array( 'id' => 'tour-test-1', - ], + ), '#children' => t('Where does the rain in Spain fail?'), - ], - 'tip-3' => [ + ), + 'tip-3' => array( '#type' => 'container', - '#attributes' => [ + '#attributes' => array( 'id' => 'tour-test-3', - ], + ), '#children' => t('Tip created now?'), - ], - 'tip-4' => [ + ), + 'tip-4' => array( '#type' => 'container', - '#attributes' => [ + '#attributes' => array( 'id' => 'tour-test-4', - ], + ), '#children' => t('Tip created later?'), - ], - 'tip-5' => [ + ), + 'tip-5' => array( '#type' => 'container', - '#attributes' => [ - 'class' => ['tour-test-5'], - ], + '#attributes' => array( + 'class' => array('tour-test-5'), + ), '#children' => t('Tip created later?'), - ], - 'code-tip-1' => [ + ), + 'code-tip-1' => array( '#type' => 'container', - '#attributes' => [ + '#attributes' => array( 'id' => 'tour-code-test-1', - ], + ), '#children' => t('Tip created now?'), - ], - ]; + ), + ); } /** * Outputs some content for testing tours. */ public function tourTest2() { - return [ + return array( '#type' => 'container', - '#attributes' => [ + '#attributes' => array( 'id' => 'tour-test-2', - ], + ), '#children' => t('Pangram example'), - ]; + ); }