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;
/**
'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;
}
'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();
* @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');
}
$fixture_module_handler = $this->getModuleHandler();
$module_handler = $this->getMockBuilder(ModuleHandler::class)
->setConstructorArgs([
- $this->root, [], $this->cacheBackend
+ $this->root, [], $this->cacheBackend,
])
->setMethods(['resetImplementations'])
->getMock();
$module_handler = $this->getMockBuilder(ModuleHandler::class)
->setConstructorArgs([
- $this->root, [], $this->cacheBackend
+ $this->root, [], $this->cacheBackend,
])
->setMethods(['resetImplementations'])
->getMock();
$module_handler = $this->getMockBuilder(ModuleHandler::class)
->setConstructorArgs([
- $this->root, [], $this->cacheBackend
+ $this->root, [], $this->cacheBackend,
])
->setMethods(['resetImplementations'])
->getMock();
'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();
'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();
'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();