PreUninstallWorkbenchModerationTest.php in Workbench Moderation to Content Moderation 8.2
File
tests/src/Functional/PreUninstallWorkbenchModerationTest.php
View source
<?php
namespace Drupal\Tests\wbm2cm\Functional;
use Drupal\Tests\BrowserTestBase;
class PreUninstallWorkbenchModerationTest extends BrowserTestBase {
protected static $modules = [
'node',
'wbm2cm',
'workbench_moderation',
];
public function testPreUninstall() {
$node_type = $this
->drupalCreateContentType()
->setThirdPartySetting('workbench_moderation', 'enabled', TRUE)
->setThirdPartySetting('workbench_moderation', 'allowed_moderation_states', [
'foo',
'bar',
'baz',
])
->setThirdPartySetting('workbench_moderation', 'default_moderation_state', 'bar');
$node_type
->save();
$this->container
->get('module_handler')
->invoke('wbm2cm', 'module_preuninstall', [
'workbench_moderation',
]);
$node_type = $this->container
->get('entity_type.manager')
->getStorage('node_type')
->load($node_type
->id());
$this
->assertNotContains('workbench_moderation', $node_type
->getThirdPartyProviders());
}
}