public function PluginSelectorBaseTest::testGetKeepPreviouslySelectedPlugins in Plugin 8.2
@covers ::setKeepPreviouslySelectedPlugins @covers ::getKeepPreviouslySelectedPlugins
@depends testGetPreviouslySelectedPlugins
File
- tests/
src/ Unit/ Plugin/ Plugin/ PluginSelector/ PluginSelectorBaseTest.php, line 127
Class
- PluginSelectorBaseTest
- @coversDefaultClass \Drupal\plugin\Plugin\Plugin\PluginSelector\PluginSelectorBase
Namespace
Drupal\Tests\plugin\Unit\Plugin\Plugin\PluginSelectorCode
public function testGetKeepPreviouslySelectedPlugins() {
$keep = (bool) mt_rand(0, 1);
$plugin = $this
->createMock(PluginInspectionInterface::class);
$this->sut
->setPreviouslySelectedPlugins([
$plugin,
]);
$this
->assertSame($this->sut, $this->sut
->setKeepPreviouslySelectedPlugins($keep));
$this
->assertSame($keep, $this->sut
->getKeepPreviouslySelectedPlugins());
// Confirm that all previously selected plugins are removed.
$this->sut
->setPreviouslySelectedPlugins([
$plugin,
]);
$this->sut
->setKeepPreviouslySelectedPlugins(FALSE);
$this
->assertEmpty($this->sut
->getPreviouslySelectedPlugins());
}