public function ServiceTest::testSettingAndGettingPlugins in Purge 8.3
Tests ::getPluginsEnabled, ::setPluginsEnabled and ::reload.
File
- tests/
src/ Kernel/ Queue/ ServiceTest.php, line 62
Class
Namespace
Drupal\Tests\purge\Kernel\QueueCode
public function testSettingAndGettingPlugins() : void {
$this->service
->setPluginsEnabled([
'file',
]);
$this
->assertTrue(in_array('file', $this->service
->getPluginsEnabled()));
$this->service
->setPluginsEnabled([
'memory',
]);
$this
->assertTrue(in_array('memory', $this->service
->getPluginsEnabled()));
$thrown = FALSE;
try {
$this->service
->setPluginsEnabled([
'DOESNOTEXIST',
]);
} catch (\LogicException $e) {
$thrown = $e instanceof \LogicException;
}
$this
->assertTrue($thrown);
$thrown = FALSE;
try {
$this->service
->setPluginsEnabled([]);
} catch (\LogicException $e) {
$thrown = $e instanceof \LogicException;
}
$this
->assertTrue($thrown);
}