public function OnlyOneModuleHandlerTest::setUp in Allow a content type only once (Only One) 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ OnlyOneModuleHandlerTest.php, line 48
Class
- OnlyOneModuleHandlerTest
- Tests the OnlyOneModuleHandler class methods.
Namespace
Drupal\Tests\onlyone\UnitCode
public function setUp() {
parent::setUp();
if (!defined('DRUPAL_MINIMUM_PHP')) {
define('DRUPAL_MINIMUM_PHP', '5.5.9');
}
// Module Handler mock.
$this->moduleHandler = $this
->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
// Renderer mock.
$this->renderer = $this
->createMock('Drupal\\Core\\Render\\RendererInterface');
// ModuleExtensionList mock.
$this->moduleExtensionList = $this
->createMock('Drupal\\Core\\Extension\\ModuleExtensionList');
// Creating the object.
$this->onlyOneModuleHandler = new OnlyOneModuleHandler($this->moduleHandler, $this->renderer, $this->moduleExtensionList);
}