public function NodeRevisionDeleteTest::setUp in Node Revision Delete 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ NodeRevisionDeleteTest.php, line 65
Class
- NodeRevisionDeleteTest
- Tests the NodeRevisionDelete class methods.
Namespace
Drupal\Tests\node_revision_delete\UnitCode
public function setUp() {
parent::setUp();
// Setting the config file.
$this->configFile = 'node_revision_delete.settings';
// Connection mock.
$this->connection = $this
->createMock('Drupal\\Core\\Database\\Connection');
// Config factory mock.
$this->configFactory = $this
->createMock('Drupal\\Core\\Config\\ConfigFactoryInterface');
// Entity Type Manager mock.
$this->entityTypeManager = $this
->createMock('Drupal\\Core\\Entity\\EntityTypeManagerInterface');
// Language Manager mock.
$this->languageManager = $this
->createMock('Drupal\\Core\\Language\\LanguageManagerInterface');
// Creating the object.
$this->nodeRevisionDelete = new NodeRevisionDelete($this->configFactory, $this
->getStringTranslationStub(), $this->connection, $this->entityTypeManager, $this->languageManager);
}