diff --git a/core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php b/core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php index 80a0c76..d0450ab 100644 --- a/core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php +++ b/core/tests/Drupal/Tests/Core/Extension/ExtensionListTest.php @@ -9,6 +9,7 @@ use Drupal\Core\Extension\ExtensionList; use Drupal\Core\Extension\InfoParserInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Extension\UnknownExtensionException; use Drupal\Core\State\StateInterface; use Drupal\Tests\UnitTestCase; use org\bovigo\vfs\vfsStream; @@ -31,7 +32,7 @@ public function testGetNameWithNonExistingExtension() { $extension_discovery->scan('test_extension')->willReturn([]); $test_extension_list->setExtensionDiscovery($extension_discovery->reveal()); - $this->setExpectedException(\InvalidArgumentException::class); + $this->setExpectedException(UnknownExtensionException::class); $test_extension_list->getName('test_name'); } @@ -55,7 +56,7 @@ public function testGetWithNonExistingExtension() { $extension_discovery->scan('test_extension')->willReturn([]); $test_extension_list->setExtensionDiscovery($extension_discovery->reveal()); - $this->setExpectedException(\InvalidArgumentException::class); + $this->setExpectedException(UnknownExtensionException::class); $test_extension_list->get('test_name'); } diff --git a/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php b/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php index 4fda002..13d3e93 100644 --- a/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php +++ b/core/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php @@ -5,6 +5,7 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\Extension; use Drupal\Core\Extension\ModuleHandler; +use Drupal\Core\Extension\UnknownExtensionException; use Drupal\Tests\UnitTestCase; /** @@ -164,7 +165,7 @@ public function testGetModuleWithExistingModule() { * @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'); }