WorkspacesIntegrationTest.php in Entity Construction Kit (ECK) 8
File
tests/src/Functional/WorkspacesIntegrationTest.php
View source
<?php
namespace Drupal\Tests\eck\Functional;
use Drupal\eck\Entity\EckEntityType;
class WorkspacesIntegrationTest extends FunctionalTestBase {
public function workspacesCanBeEnabledWhenNoEntityTypesAreDefined() {
$this->container
->get('module_installer')
->install([
'workspaces',
], TRUE);
}
public function workspacesCanBeEnabledWhenEntityTypeIsDefined() {
$testType = EckEntityType::create([
'id' => 'test',
'label' => 'Test',
]);
$testType
->save();
$this->container
->get('module_installer')
->install([
'workspaces',
], TRUE);
}
public function cacheCanBeClearedWhenWorkbenchIsEnabled() {
$testType = EckEntityType::create([
'id' => 'test',
'label' => 'Test',
]);
$testType
->save();
$this->container
->get('module_installer')
->install([
'workspaces',
], TRUE);
drupal_flush_all_caches();
}
public function newEntityTypesCanBeCreatedWhenWorkbenchIsEnabled() {
$this
->assertEquals(0, \count(EckEntityType::loadMultiple()));
$this->container
->get('module_installer')
->install([
'workspaces',
], TRUE);
$testType = EckEntityType::create([
'id' => 'test',
'label' => 'Test',
]);
$testType
->save();
$this
->assertEquals(1, \count(EckEntityType::loadMultiple()));
}
}