config = $objectManager->get(ReinitableConfigInterface::class); $this->factory = $objectManager->get(WysiwygRestrictCommandFactory::class); } /** * "Execute" method cases. * * @return array */ public function getExecuteCases(): array { return [ 'yes' => ['y', true], 'no' => ['n', false], 'no-but-different' => ['what', false] ]; } /** * Test the command. * * @param string $argument * @param bool $expectedFlag * @return void * @dataProvider getExecuteCases * @magentoConfigFixture default_store cms/wysiwyg/force_valid 0 */ public function testExecute(string $argument, bool $expectedFlag): void { /** @var WysiwygRestrictCommand $model */ $model = $this->factory->create(); $tester = new CommandTester($model); $tester->execute(['restrict' => $argument]); $this->config->reinit(); $this->assertEquals($expectedFlag, $this->config->isSetFlag(Validator::CONFIG_PATH_THROW_EXCEPTION)); } }