RulesUiEmbedTest.php in Rules 8.3
File
tests/src/Kernel/RulesUiEmbedTest.php
View source
<?php
namespace Drupal\Tests\rules\Kernel;
use Drupal\rules\Ui\RulesUiConfigHandler;
use Drupal\rules\Ui\RulesUiDefinition;
class RulesUiEmbedTest extends RulesKernelTestBase {
protected static $modules = [
'rules',
'rules_test_ui_embed',
'system',
'user',
];
protected $rulesUiManager;
protected function setUp() : void {
parent::setUp();
$this->rulesUiManager = $this->container
->get('plugin.manager.rules_ui');
$this
->installConfig([
'system',
]);
$this
->installConfig([
'rules_test_ui_embed',
]);
$this
->installSchema('system', [
'sequences',
]);
}
public function testUiManager() {
$definition = $this->rulesUiManager
->getDefinitions();
$this
->assertTrue(isset($definition['rules_test_ui_embed.settings_conditions']));
$this
->assertInstanceOf(RulesUiDefinition::class, $definition['rules_test_ui_embed.settings_conditions']);
$this
->assertTrue(!empty($definition['rules_test_ui_embed.settings_conditions']->label));
$this
->assertEquals(RulesUiConfigHandler::class, $definition['rules_test_ui_embed.settings_conditions']
->getClass());
}
}