Problem/Motivation

As title.

Proposed resolution

For example:


- $this->assertTrue(array_key_exists($route_name, $sample_routes));
+ $this->assertArrayHasKey($route_name,$sample_routes);

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3155760-2.patch744 bytesHardik_Patel_12
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Hardik_Patel_12 created an issue. See original summary.

Hardik_Patel_12’s picture

siddhant.bhosale’s picture

Assigned: Unassigned » siddhant.bhosale
siddhant.bhosale’s picture

Assigned: siddhant.bhosale » Unassigned
Status: Needs review » Reviewed & tested by the community

Hi, I have tested the patch. Looks good to be merged and also the test runs successfully.

$ vendor/bin/phpunit -c core/ --filter RouteProviderTest
PHPUnit 8.5.5 by Sebastian Bergmann and contributors.

Testing
.......................................................           55 / 55 (100%)

Time: 1.12 minutes, Memory: 833.00 MB

OK (55 tests, 262 assertions)

Thank you.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed
diff --git a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
index 34d2dfb77f..129e5e2131 100644
--- a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php
@@ -314,7 +314,7 @@ public function testGetAllRoutes() {
     $this->assertEqual($expected_route_count, count($returned_routes));
 
     foreach ($returned_routes as $route_name => $route) {
-      $this->assertArrayHasKey($route_name,$sample_routes);
+      $this->assertArrayHasKey($route_name, $sample_routes);
       $this->assertEquals($route->getPath(), $sample_routes[$route_name]['path']);
     }
   }

Fixing coding standards on commit. @Hardik_Patel_12 you should consider running phpcs on the changed files when you make a commit.

Committed 01b2e5a and pushed to 9.1.x. Thanks!

Didn't bother backporting because of conflicts.

  • alexpott committed 01b2e5a on 9.1.x
    Issue #3155760 by Hardik_Patel_12: Replace assertions involving calls to...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.