Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Extension / ModuleHandlerTest.php
index 4fda0022b7d59a652a76ebb9de0295d3024c39ec..3adaf13507a3c625f1bde0ae82fd1988a7abcc44 100644 (file)
@@ -5,6 +5,7 @@ namespace Drupal\Tests\Core\Extension;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Extension\Extension;
 use Drupal\Core\Extension\ModuleHandler;
+use Drupal\Core\Extension\Exception\UnknownExtensionException;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -52,7 +53,7 @@ class ModuleHandlerTest extends UnitTestCase {
         'type' => 'module',
         'pathname' => 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml',
         'filename' => 'module_handler_test.module',
-      ]
+      ],
     ], $this->cacheBackend);
     return $module_handler;
   }
@@ -107,8 +108,8 @@ class ModuleHandlerTest extends UnitTestCase {
             'type' => 'module',
             'pathname' => 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml',
             'filename' => 'module_handler_test.module',
-          ]
-        ], $this->cacheBackend
+          ],
+        ], $this->cacheBackend,
       ])
       ->setMethods(['load'])
       ->getMock();
@@ -164,7 +165,7 @@ class ModuleHandlerTest extends UnitTestCase {
    * @covers ::getModule
    */
   public function testGetModuleWithNonExistingModule() {
-    $this->setExpectedException(\InvalidArgumentException::class);
+    $this->setExpectedException(UnknownExtensionException::class);
     $this->getModuleHandler()->getModule('claire_alice_watch_my_little_pony_module_that_does_not_exist');
   }
 
@@ -177,7 +178,7 @@ class ModuleHandlerTest extends UnitTestCase {
     $fixture_module_handler = $this->getModuleHandler();
     $module_handler = $this->getMockBuilder(ModuleHandler::class)
       ->setConstructorArgs([
-        $this->root, [], $this->cacheBackend
+        $this->root, [], $this->cacheBackend,
       ])
       ->setMethods(['resetImplementations'])
       ->getMock();
@@ -205,7 +206,7 @@ class ModuleHandlerTest extends UnitTestCase {
 
     $module_handler = $this->getMockBuilder(ModuleHandler::class)
       ->setConstructorArgs([
-        $this->root, [], $this->cacheBackend
+        $this->root, [], $this->cacheBackend,
       ])
       ->setMethods(['resetImplementations'])
       ->getMock();
@@ -227,7 +228,7 @@ class ModuleHandlerTest extends UnitTestCase {
 
     $module_handler = $this->getMockBuilder(ModuleHandler::class)
       ->setConstructorArgs([
-        $this->root, [], $this->cacheBackend
+        $this->root, [], $this->cacheBackend,
       ])
       ->setMethods(['resetImplementations'])
       ->getMock();
@@ -264,8 +265,8 @@ class ModuleHandlerTest extends UnitTestCase {
             'type' => 'module',
             'pathname' => 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml',
             'filename' => 'module_handler_test.module',
-          ]
-        ], $this->cacheBackend
+          ],
+        ], $this->cacheBackend,
       ])
       ->setMethods(['loadInclude'])
       ->getMock();
@@ -353,8 +354,8 @@ class ModuleHandlerTest extends UnitTestCase {
             'type' => 'module',
             'pathname' => 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml',
             'filename' => 'module_handler_test.module',
-          ]
-        ], $this->cacheBackend
+          ],
+        ], $this->cacheBackend,
       ])
       ->setMethods(['buildImplementationInfo', 'loadInclude'])
       ->getMock();
@@ -391,8 +392,8 @@ class ModuleHandlerTest extends UnitTestCase {
             'type' => 'module',
             'pathname' => 'core/tests/Drupal/Tests/Core/Extension/modules/module_handler_test/module_handler_test.info.yml',
             'filename' => 'module_handler_test.module',
-          ]
-        ], $this->cacheBackend
+          ],
+        ], $this->cacheBackend,
       ])
       ->setMethods(['buildImplementationInfo'])
       ->getMock();