diff --git a/tests/modules/rules_test_event/src/Event/GetterEvent.php b/tests/modules/rules_test_event/src/Event/GetterEvent.php index 70baeae29553d6b0af6dc7450b58e4f1fd721344..3b3cc0a0b21b5d430e3e7cddfe77af2f476bac4c 100644 --- a/tests/modules/rules_test_event/src/Event/GetterEvent.php +++ b/tests/modules/rules_test_event/src/Event/GetterEvent.php @@ -52,7 +52,7 @@ class GetterEvent extends Event { * @return string * The value of publicProperty. */ - public function publicGetter() { + public function publicGetter(): string { return $this->publicProperty; } @@ -62,7 +62,7 @@ class GetterEvent extends Event { * @return string * The value of protectedProperty. */ - public function protectedGetter() { + public function protectedGetter(): string { return $this->protectedProperty; } @@ -72,7 +72,7 @@ class GetterEvent extends Event { * @return string * The value of privateProperty. */ - public function privateGetter() { + public function privateGetter(): string { return $this->privateProperty; } diff --git a/tests/src/Functional/ActionsFormTest.php b/tests/src/Functional/ActionsFormTest.php index db8cc450e06dffb63866b1fa4d329f5fdbf5ccce..a615c0d9137cafe3ded1bc64c538ae61f535ad32 100644 --- a/tests/src/Functional/ActionsFormTest.php +++ b/tests/src/Functional/ActionsFormTest.php @@ -67,7 +67,7 @@ class ActionsFormTest extends RulesBrowserTestBase { * * @dataProvider dataActionsFormWidgets */ - public function testActionsFormWidgets($id, $required = [], $defaulted = [], $widgets = [], $selectors = [], $provides = []) { + public function testActionsFormWidgets(string $id, array $required = [], array $defaulted = [], array $widgets = [], array $selectors = [], array $provides = []): void { $expressionManager = $this->container->get('plugin.manager.rules_expression'); $storage = $this->container->get('entity_type.manager')->getStorage('rules_reaction_rule'); diff --git a/tests/src/Functional/ConditionsFormTest.php b/tests/src/Functional/ConditionsFormTest.php index 3582c89694a6752e9a7258e7490f218dbd520c6b..f00de85d345a85e9feaa05c6d9420eb9dd61e527 100644 --- a/tests/src/Functional/ConditionsFormTest.php +++ b/tests/src/Functional/ConditionsFormTest.php @@ -67,7 +67,7 @@ class ConditionsFormTest extends RulesBrowserTestBase { * * @dataProvider dataConditionsFormWidgets */ - public function testConditionsFormWidgets($id, $required = [], $defaulted = [], $widgets = [], $selectors = []) { + public function testConditionsFormWidgets(string $id, array $required = [], array $defaulted = [], array $widgets = [], array $selectors = []): void { $expressionManager = $this->container->get('plugin.manager.rules_expression'); $storage = $this->container->get('entity_type.manager')->getStorage('rules_reaction_rule'); diff --git a/tests/src/Functional/ConfigureAndExecuteTest.php b/tests/src/Functional/ConfigureAndExecuteTest.php index fbda2591b7c0123c64db3469dca3accec0ecb42e..053b51b06fc162d79919f877eaae2135b0d443bc 100644 --- a/tests/src/Functional/ConfigureAndExecuteTest.php +++ b/tests/src/Functional/ConfigureAndExecuteTest.php @@ -107,7 +107,7 @@ class ConfigureAndExecuteTest extends RulesBrowserTestBase { /** * Tests creation of a rule and then triggering its execution. */ - public function testConfigureAndExecute() { + public function testConfigureAndExecute(): void { // Set up a rule that will show a system message if the title of a node // matches "Test title". $this->createRule('Test rule', 'test_rule', 'rules_entity_presave:node'); @@ -184,7 +184,7 @@ class ConfigureAndExecuteTest extends RulesBrowserTestBase { /** * Tests adding an event and then triggering its execution. */ - public function testAddEventAndExecute() { + public function testAddEventAndExecute(): void { // Create an article. $node = $this->drupalCreateNode([ 'type' => 'article', @@ -239,7 +239,7 @@ class ConfigureAndExecuteTest extends RulesBrowserTestBase { /** * Tests deleting an event and then triggering its execution. */ - public function testDeleteEventAndExecute() { + public function testDeleteEventAndExecute(): void { // Create a rule with two events and an action. $message = 'Rule is triggered'; $rule = $this->expressionManager->createRule(); @@ -297,7 +297,7 @@ class ConfigureAndExecuteTest extends RulesBrowserTestBase { /** * Tests creating and altering two rules reacting on the same event. */ - public function testTwoRulesSameEvent() { + public function testTwoRulesSameEvent(): void { /** @var \Drupal\Tests\WebAssert $assert */ $assert = $this->assertSession(); @@ -427,7 +427,7 @@ class ConfigureAndExecuteTest extends RulesBrowserTestBase { /** * Tests user input in context form for 'multiple' valued context variables. */ - public function testMultipleInputContext() { + public function testMultipleInputContext(): void { // Set up a rule. The event is not relevant, we just want a rule to use. // Calling $rule = $this->createRule('Test Multiple Input via UI', // 'test_rule', 'rules_entity_insert:node') works locally but fails @@ -513,7 +513,7 @@ class ConfigureAndExecuteTest extends RulesBrowserTestBase { /** * Tests the implementation of assignment restriction in context form. */ - public function testAssignmentRestriction() { + public function testAssignmentRestriction(): void { // Create a rule. $rule = $this->expressionManager->createRule(); @@ -573,7 +573,7 @@ class ConfigureAndExecuteTest extends RulesBrowserTestBase { /** * Tests upcasting in a condition. */ - public function testUpcastInCondition() { + public function testUpcastInCondition(): void { /** @var \Drupal\Tests\WebAssert $assert */ $assert = $this->assertSession(); @@ -628,7 +628,7 @@ class ConfigureAndExecuteTest extends RulesBrowserTestBase { /** * Tests upcasting in an action. */ - public function testUpcastInAction() { + public function testUpcastInAction(): void { // Log in. $this->drupalLogin($this->account); diff --git a/tests/src/Functional/OptionsProvider/OptionsProviderTest.php b/tests/src/Functional/OptionsProvider/OptionsProviderTest.php index 0a6ef1e9b5ad921264cdfc55aaac49f328aaf411..b511d75d57d1213e8543bd0b181ec97df60bb707 100644 --- a/tests/src/Functional/OptionsProvider/OptionsProviderTest.php +++ b/tests/src/Functional/OptionsProvider/OptionsProviderTest.php @@ -75,7 +75,7 @@ class OptionsProviderTest extends BrowserTestBase { * * @dataProvider provideOptionsProviders */ - public function testOptionsProvider($definition, array $options) { + public function testOptionsProvider(string $definition, array $options): void { $provider = $this->classResolver->getInstanceFromDefinition($definition); $flatten_options = OptGroup::flattenOptions($options); diff --git a/tests/src/Functional/RulesBrowserTestBase.php b/tests/src/Functional/RulesBrowserTestBase.php index e54b6535a906d5eb4057d62aa7aab2e8f1221794..bd301ded5fe433ebcbc9b33325bdd620b493ac05 100644 --- a/tests/src/Functional/RulesBrowserTestBase.php +++ b/tests/src/Functional/RulesBrowserTestBase.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\rules\Functional; +use Behat\Mink\Element\NodeElement; use Drupal\Tests\BrowserTestBase; /** @@ -23,7 +24,7 @@ abstract class RulesBrowserTestBase extends BrowserTestBase { * @return \Behat\Mink\Element\NodeElement|null * The link node element. */ - public function findLink($locator) { + public function findLink(string $locator): NodeElement { return $this->getSession()->getPage()->findLink($locator); } @@ -39,7 +40,7 @@ abstract class RulesBrowserTestBase extends BrowserTestBase { * @param string $href * The href, or a unique part of it. */ - public function clickLinkByHref($href) { + public function clickLinkByHref(string $href) { $this->getSession()->getPage()->find('xpath', './/a[contains(@href, "' . $href . '")]')->click(); } @@ -52,7 +53,7 @@ abstract class RulesBrowserTestBase extends BrowserTestBase { * @return \Behat\Mink\Element\NodeElement|null * The input field element. */ - public function findField($locator) { + public function findField(string $locator): NodeElement { return $this->getSession()->getPage()->findField($locator); } @@ -65,7 +66,7 @@ abstract class RulesBrowserTestBase extends BrowserTestBase { * @return \Behat\Mink\Element\NodeElement|null * The button node element. */ - public function findButton($locator) { + public function findButton(string $locator): NodeElement { return $this->getSession()->getPage()->findButton($locator); } @@ -77,7 +78,7 @@ abstract class RulesBrowserTestBase extends BrowserTestBase { * * @throws \Behat\Mink\Exception\ElementNotFoundException */ - public function pressButton($locator) { + public function pressButton(string $locator) { $this->getSession()->getPage()->pressButton($locator); } @@ -93,7 +94,7 @@ abstract class RulesBrowserTestBase extends BrowserTestBase { * * @see \Behat\Mink\Element\NodeElement::setValue */ - public function fillField($locator, $value) { + public function fillField(string $locator, string $value) { $this->getSession()->getPage()->fillField($locator, $value); } diff --git a/tests/src/Functional/RulesComponentListBuilderTest.php b/tests/src/Functional/RulesComponentListBuilderTest.php index 79098bf38a1c13169685d29c298eafdb9630bcb4..89ef5c652ef4a81e64732b9268c9235dcba8e6fa 100644 --- a/tests/src/Functional/RulesComponentListBuilderTest.php +++ b/tests/src/Functional/RulesComponentListBuilderTest.php @@ -47,7 +47,7 @@ class RulesComponentListBuilderTest extends RulesBrowserTestBase { /** * Tests that the rule component listing page is reachable. */ - public function testRuleComponentPage() { + public function testRuleComponentPage(): void { $this->drupalLogin($this->adminUser); $this->drupalGet('admin/config/workflow/rules/components'); @@ -63,7 +63,7 @@ class RulesComponentListBuilderTest extends RulesBrowserTestBase { /** * Tests that creating a rules component works. */ - public function testCreateRulesComponent() { + public function testCreateRulesComponent(): void { $this->drupalLogin($this->adminUser); $this->drupalGet('admin/config/workflow/rules/components'); @@ -96,7 +96,7 @@ class RulesComponentListBuilderTest extends RulesBrowserTestBase { /** * Tests that cancelling an expression from a component works. */ - public function testCancelExpressionInComponent() { + public function testCancelExpressionInComponent(): void { // Setup a rule with one condition. $this->testCreateRulesComponent(); @@ -122,7 +122,7 @@ class RulesComponentListBuilderTest extends RulesBrowserTestBase { /** * Tests that deleting an expression from a rule works. */ - public function testDeleteExpressionInComponent() { + public function testDeleteExpressionInComponent(): void { // Setup a rule with one condition. $this->testCreateRulesComponent(); @@ -142,7 +142,7 @@ class RulesComponentListBuilderTest extends RulesBrowserTestBase { /** * Tests that a condition with no context can be configured. */ - public function testNoContextCondition() { + public function testNoContextCondition(): void { // Setup a rule with one condition. $this->testCreateRulesComponent(); @@ -159,7 +159,7 @@ class RulesComponentListBuilderTest extends RulesBrowserTestBase { /** * Tests that a negated condition has NOT prefixed to its label. */ - public function testNegatedCondition() { + public function testNegatedCondition(): void { // Setup a rule with one condition. $this->testCreateRulesComponent(); @@ -178,7 +178,7 @@ class RulesComponentListBuilderTest extends RulesBrowserTestBase { /** * Tests that an action with a 'multiple' context can be configured. */ - public function testMultipleContextAction() { + public function testMultipleContextAction(): void { $this->drupalLogin($this->adminUser); $this->drupalGet('admin/config/workflow/rules/components'); diff --git a/tests/src/Functional/RulesDebugLogTest.php b/tests/src/Functional/RulesDebugLogTest.php index 71804c558ceaac429606482e35501fcd5f4f6bc0..8369a9f67ccd03985540c0d4ff908dbaad90b290 100644 --- a/tests/src/Functional/RulesDebugLogTest.php +++ b/tests/src/Functional/RulesDebugLogTest.php @@ -44,7 +44,7 @@ class RulesDebugLogTest extends RulesBrowserTestBase { /** * Tests that entity CRUD events get fired only once. */ - public function testEventDebugLogMessage() { + public function testEventDebugLogMessage(): void { // Create a user who can see the rules debug logs. $account = $this->createUser([ 'administer rules', diff --git a/tests/src/Functional/RulesUiEmbedTest.php b/tests/src/Functional/RulesUiEmbedTest.php index 857b1954bd1697798379be69b7ed4eb03b6dc0d1..0074f8cad4bf2db23ec47df6e9c9545e844c9c50 100644 --- a/tests/src/Functional/RulesUiEmbedTest.php +++ b/tests/src/Functional/RulesUiEmbedTest.php @@ -17,7 +17,7 @@ class RulesUiEmbedTest extends RulesBrowserTestBase { /** * @covers \Drupal\rules_test_ui_embed\Form\SettingsForm */ - public function testExampleUi() { + public function testExampleUi(): void { $account = $this->drupalCreateUser([ 'administer rules', 'access administration pages', diff --git a/tests/src/Functional/TempStorageTest.php b/tests/src/Functional/TempStorageTest.php index 931b5d288a656fe39df11be659dc675dfb927cc2..c819d7a7248af3ea7b02df6e1a55459d690912d1 100644 --- a/tests/src/Functional/TempStorageTest.php +++ b/tests/src/Functional/TempStorageTest.php @@ -24,7 +24,7 @@ class TempStorageTest extends RulesBrowserTestBase { /** * Tests that editing a rule locks it for another user. */ - public function testLocking() { + public function testLocking(): void { // Create a rule with the first user. $account_1 = $this->drupalCreateUser(['administer rules']); $this->drupalLogin($account_1); diff --git a/tests/src/Functional/UiPageTest.php b/tests/src/Functional/UiPageTest.php index 75a0899370c28ae9e8b8e2bb82c13d8dea8f76d1..c4849f1cff5ed12a06de29bab94280af7234656b 100644 --- a/tests/src/Functional/UiPageTest.php +++ b/tests/src/Functional/UiPageTest.php @@ -49,7 +49,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that the reaction rule listing page is reachable. */ - public function testReactionRulePage() { + public function testReactionRulePage(): void { $account = $this->drupalCreateUser(['administer rules']); $this->drupalLogin($account); @@ -66,7 +66,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that creating a reaction rule works. */ - public function testCreateReactionRule() { + public function testCreateReactionRule(): void { $this->drupalLogin($this->adminUser); $this->drupalGet('admin/config/workflow/rules'); @@ -101,7 +101,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that enabling and disabling a rule works. */ - public function testRuleStatusOperations() { + public function testRuleStatusOperations(): void { // Setup an active rule. $this->testCreateReactionRule(); $this->drupalGet('admin/config/workflow/rules'); @@ -121,7 +121,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that an event can be added. */ - public function testAddEvent() { + public function testAddEvent(): void { // Setup an active rule. $this->testCreateReactionRule(); @@ -153,7 +153,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that an event with type restriction can be added. */ - public function testAddEventWithRestrictByType() { + public function testAddEventWithRestrictByType(): void { // Add a content type called 'article'. $node_type = NodeType::create([ 'type' => 'article', @@ -196,7 +196,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that an event can be deleted. */ - public function testDeleteEvent() { + public function testDeleteEvent(): void { // Create a rule with two events. $rule = $this->storage->create([ 'id' => 'test_rule', @@ -240,7 +240,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that events cannot be deleted when there is only one event. */ - public function testNoDeleteEventWhenRulesHasSingleEvent() { + public function testNoDeleteEventWhenRulesHasSingleEvent(): void { // Create a rule. $rule = $this->storage->create([ 'id' => 'test_rule', @@ -271,7 +271,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that cancelling an expression from a rule works. */ - public function testCancelExpressionInRule() { + public function testCancelExpressionInRule(): void { // Setup a rule with one condition. $this->testCreateReactionRule(); @@ -297,7 +297,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that deleting an expression from a rule works. */ - public function testDeleteExpressionInRule() { + public function testDeleteExpressionInRule(): void { // Setup a rule with one condition. $this->testCreateReactionRule(); @@ -317,7 +317,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that a condition with no context can be configured. */ - public function testNoContextCondition() { + public function testNoContextCondition(): void { // Setup a rule with one condition. $this->testCreateReactionRule(); @@ -334,7 +334,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that a negated condition has NOT prefixed to its label. */ - public function testNegatedCondition() { + public function testNegatedCondition(): void { // Setup a rule with one condition. $this->testCreateReactionRule(); @@ -353,7 +353,7 @@ class UiPageTest extends RulesBrowserTestBase { /** * Tests that an action with a 'multiple' context can be configured. */ - public function testMultipleContextAction() { + public function testMultipleContextAction(): void { $this->drupalLogin($this->adminUser); $this->drupalGet('admin/config/workflow/rules'); diff --git a/tests/src/FunctionalJavascript/EventBundleTest.php b/tests/src/FunctionalJavascript/EventBundleTest.php index 9ce939479c130ea758aedefd2ed48f3cd6d87164..af26197a74a999b32dba046d90391ac4825478de 100644 --- a/tests/src/FunctionalJavascript/EventBundleTest.php +++ b/tests/src/FunctionalJavascript/EventBundleTest.php @@ -44,7 +44,7 @@ class EventBundleTest extends WebDriverTestBase { /** * Tests that event bundle selection Ajax works. */ - public function testEventBundleSelection() { + public function testEventBundleSelection(): void { // A user who can create rules in the UI. $account = $this->createUser(['administer rules']); $this->drupalLogin($account); diff --git a/tests/src/Kernel/ConfigEntityDefaultsTest.php b/tests/src/Kernel/ConfigEntityDefaultsTest.php index a2689fce124224c4dd7dd08d256b0f9e5f2e8c0d..fb9708d21dedc0ea7fd5a221dda8d965fb198bab 100644 --- a/tests/src/Kernel/ConfigEntityDefaultsTest.php +++ b/tests/src/Kernel/ConfigEntityDefaultsTest.php @@ -54,7 +54,7 @@ class ConfigEntityDefaultsTest extends RulesKernelTestBase { /** * Tests Rules default components. */ - public function testDefaultComponents() { + public function testDefaultComponents(): void { $config_entity = $this->storage->load('rules_test_default_component'); $user = $this->entityTypeManager->getStorage('user') diff --git a/tests/src/Kernel/ConfigEntityTest.php b/tests/src/Kernel/ConfigEntityTest.php index 22dcf4c391cb6563c2b06bbaa96ab21c74665dde..e3f19042f12d526d6759e5dba9cf549054ab7d14 100644 --- a/tests/src/Kernel/ConfigEntityTest.php +++ b/tests/src/Kernel/ConfigEntityTest.php @@ -32,7 +32,7 @@ class ConfigEntityTest extends RulesKernelTestBase { /** * Tests that an empty rule configuration can be saved. */ - public function testSavingEmptyRule() { + public function testSavingEmptyRule(): void { // This test does not perform assertions, and the @doesNotPerformAssertions // annotation does not work properly in DrupalCI for PHP 7.4. // @see https://www.drupal.org/project/rules/issues/3179763 @@ -48,7 +48,7 @@ class ConfigEntityTest extends RulesKernelTestBase { /** * Tests saving the configuration of an action and then loading it again. */ - public function testConfigAction() { + public function testConfigAction(): void { $action = $this->expressionManager->createAction('rules_test_debug_log'); $config_entity = $this->storage->create([ 'id' => 'test_rule', @@ -73,7 +73,7 @@ class ConfigEntityTest extends RulesKernelTestBase { /** * Tests saving the nested config of a rule and then loading it again. */ - public function testConfigRule() { + public function testConfigRule(): void { // Create a simple rule with one action and one condition. $rule = $this->expressionManager->createRule(); $rule->addCondition('rules_test_true'); @@ -96,7 +96,7 @@ class ConfigEntityTest extends RulesKernelTestBase { /** * Make sure that expressions using context definitions can be exported. */ - public function testContextDefinitionExport() { + public function testContextDefinitionExport(): void { $component = RulesComponent::create($this->expressionManager->createRule()) ->addContextDefinition('test', ContextDefinition::create('string') ->setLabel('Test string') @@ -119,7 +119,7 @@ class ConfigEntityTest extends RulesKernelTestBase { /** * Tests that a reaction rule config entity can be saved. */ - public function testReactionRuleSaving() { + public function testReactionRuleSaving(): void { // This test does not perform assertions, and the @doesNotPerformAssertions // annotation does not work properly in DrupalCI for PHP 7.4. // @see https://www.drupal.org/project/rules/issues/3179763 diff --git a/tests/src/Kernel/ConfigSchemaTest.php b/tests/src/Kernel/ConfigSchemaTest.php index 832babd4b15e510b9183bda3d5c49de3c662e6c5..9ca960fbd20521235ce4421cbc568a82b1bea45d 100644 --- a/tests/src/Kernel/ConfigSchemaTest.php +++ b/tests/src/Kernel/ConfigSchemaTest.php @@ -30,7 +30,7 @@ class ConfigSchemaTest extends RulesKernelTestBase { /** * Make sure the system send email config schema works on saving. */ - public function testMailActionContextSchema() { + public function testMailActionContextSchema(): void { // This test does not perform assertions, and the @doesNotPerformAssertions // annotation does not work properly in DrupalCI for PHP 7.4. // @see https://www.drupal.org/project/rules/issues/3179763 diff --git a/tests/src/Kernel/ConfigurableEventHandlerTest.php b/tests/src/Kernel/ConfigurableEventHandlerTest.php index f91e136cb6014bc88144f52720d68da324840142..e7ac7afcebcd2116c8a415a55f78bfc63731659e 100644 --- a/tests/src/Kernel/ConfigurableEventHandlerTest.php +++ b/tests/src/Kernel/ConfigurableEventHandlerTest.php @@ -81,7 +81,7 @@ class ConfigurableEventHandlerTest extends RulesKernelTestBase { * * @todo Add integrity check that node.field_integer is detected by Rules. */ - public function testConfigurableEventHandler() { + public function testConfigurableEventHandler(): void { // Create rule1 with the 'rules_entity_presave:node--page' event. $rule1 = $this->expressionManager->createRule(); $rule1->addAction('rules_test_debug_log', diff --git a/tests/src/Kernel/ContextIntegrationTest.php b/tests/src/Kernel/ContextIntegrationTest.php index c6be0458780dc0be591c139485a1971ad8bba59d..e2a1ef944bf4e88d6508c4be98d6c3db587757b8 100644 --- a/tests/src/Kernel/ContextIntegrationTest.php +++ b/tests/src/Kernel/ContextIntegrationTest.php @@ -17,7 +17,7 @@ class ContextIntegrationTest extends RulesKernelTestBase { /** * Tests that a required context mapping that is NULL throws an exception. */ - public function testRequiredNullMapping() { + public function testRequiredNullMapping(): void { // Configure a simple rule with one action. $action = $this->expressionManager->createInstance('rules_action', ContextConfig::create() @@ -45,7 +45,7 @@ class ContextIntegrationTest extends RulesKernelTestBase { /** * Tests that a required context value that is NULL throws an exception. */ - public function testRequiredNullValue() { + public function testRequiredNullValue(): void { // Configure a simple rule with one action. The required 'text' context is // set to be NULL. $action = $this->expressionManager->createInstance('rules_action', @@ -69,7 +69,7 @@ class ContextIntegrationTest extends RulesKernelTestBase { /** * Tests that NULL values for contexts are allowed if specified. */ - public function testAllowNullValue() { + public function testAllowNullValue(): void { // Configure a simple rule with the data set action which allows NULL // values. $action = $this->expressionManager->createInstance('rules_action', @@ -97,7 +97,7 @@ class ContextIntegrationTest extends RulesKernelTestBase { /** * Tests the assignment restriction on context definitions. */ - public function testAssignmentRestriction() { + public function testAssignmentRestriction(): void { $action_manager = $this->container->get('plugin.manager.rules_action'); // Test the assignment restriction on the entity fetch action as an example. diff --git a/tests/src/Kernel/ContextProvider/CurrentDateContextTest.php b/tests/src/Kernel/ContextProvider/CurrentDateContextTest.php index 12788d579a8a444732f425c16058637d67a80ba9..e47a9da9eb19c8f81fa6f9921f2b55743b864268 100644 --- a/tests/src/Kernel/ContextProvider/CurrentDateContextTest.php +++ b/tests/src/Kernel/ContextProvider/CurrentDateContextTest.php @@ -36,7 +36,7 @@ class CurrentDateContextTest extends KernelTestBase { /** * @covers ::getAvailableContexts */ - public function testGetAvailableContexts() { + public function testGetAvailableContexts(): void { $context_repository = $this->container->get('context.repository'); // Test an authenticated account. diff --git a/tests/src/Kernel/ContextProvider/CurrentPathContextTest.php b/tests/src/Kernel/ContextProvider/CurrentPathContextTest.php index b2b8dfda40a4b3cceec6bfc2deff97e6a0347b23..d3df939c501ad472c525fc5341490362e48dad78 100644 --- a/tests/src/Kernel/ContextProvider/CurrentPathContextTest.php +++ b/tests/src/Kernel/ContextProvider/CurrentPathContextTest.php @@ -36,7 +36,7 @@ class CurrentPathContextTest extends KernelTestBase { /** * @covers ::getAvailableContexts */ - public function testGetAvailableContexts() { + public function testGetAvailableContexts(): void { $context_repository = $this->container->get('context.repository'); // Test an authenticated account. diff --git a/tests/src/Kernel/ContextProvider/SiteContextTest.php b/tests/src/Kernel/ContextProvider/SiteContextTest.php index b7f4568876e11f67773c962d9e01abb0197016b5..2a259ad5938e960f9a7c124fd12bbb27536c085f 100644 --- a/tests/src/Kernel/ContextProvider/SiteContextTest.php +++ b/tests/src/Kernel/ContextProvider/SiteContextTest.php @@ -36,7 +36,7 @@ class SiteContextTest extends KernelTestBase { /** * @covers ::getAvailableContexts */ - public function testGetAvailableContexts() { + public function testGetAvailableContexts(): void { $context_repository = $this->container->get('context.repository'); // Test an authenticated account. diff --git a/tests/src/Kernel/CoreIntegrationTest.php b/tests/src/Kernel/CoreIntegrationTest.php index 4295bd07d38f94e08101d6e6921f036e56df5e75..96a9018ce1e7696d6111521ef0f6ae239950fe7c 100644 --- a/tests/src/Kernel/CoreIntegrationTest.php +++ b/tests/src/Kernel/CoreIntegrationTest.php @@ -38,7 +38,7 @@ class CoreIntegrationTest extends RulesKernelTestBase { /** * Tests that a complex data selector can be applied to entities. */ - public function testEntityPropertyPath() { + public function testEntityPropertyPath(): void { $entity_type_manager = $this->container->get('entity_type.manager'); $entity_type_manager->getStorage('node_type') ->create(['type' => 'page']) @@ -84,7 +84,7 @@ class CoreIntegrationTest extends RulesKernelTestBase { /** * Tests that an entity is automatically saved after being changed. */ - public function testEntityAutoSave() { + public function testEntityAutoSave(): void { $entity_type_manager = $this->container->get('entity_type.manager'); $entity_type_manager->getStorage('node_type') ->create(['type' => 'page']) @@ -118,7 +118,7 @@ class CoreIntegrationTest extends RulesKernelTestBase { /** * Tests that tokens in action parameters get replaced. */ - public function testTokenReplacements() { + public function testTokenReplacements(): void { $entity_type_manager = $this->container->get('entity_type.manager'); $entity_type_manager->getStorage('node_type') ->create(['type' => 'page']) @@ -167,7 +167,7 @@ class CoreIntegrationTest extends RulesKernelTestBase { /** * Tests that tokens used to format entity fields get replaced. */ - public function testTokenFormattingReplacements() { + public function testTokenFormattingReplacements(): void { $entity_type_manager = $this->container->get('entity_type.manager'); $entity_type_manager->getStorage('node_type') ->create(['type' => 'page']) @@ -210,7 +210,7 @@ class CoreIntegrationTest extends RulesKernelTestBase { /** * Tests that the data set action works on entities. */ - public function testDataSetEntities() { + public function testDataSetEntities(): void { $entity_type_manager = $this->container->get('entity_type.manager'); $entity_type_manager->getStorage('node_type') ->create(['type' => 'page']) @@ -248,7 +248,7 @@ class CoreIntegrationTest extends RulesKernelTestBase { /** * Tests that auto saving in a component executed as action works. */ - public function testComponentActionAutoSave() { + public function testComponentActionAutoSave(): void { $entity_type_manager = $this->container->get('entity_type.manager'); $entity_type_manager->getStorage('node_type') ->create(['type' => 'page']) @@ -287,7 +287,7 @@ class CoreIntegrationTest extends RulesKernelTestBase { /** * Tests using global context. */ - public function testGlobalContext() { + public function testGlobalContext(): void { $account = User::create([ 'name' => 'hubert', ]); diff --git a/tests/src/Kernel/DataProcessorTest.php b/tests/src/Kernel/DataProcessorTest.php index 245d3d2daa3c188848bfb8e7495f886c9f39f420..61db0791f902c71e57b20806663a3ac0bf88ab83 100644 --- a/tests/src/Kernel/DataProcessorTest.php +++ b/tests/src/Kernel/DataProcessorTest.php @@ -17,7 +17,7 @@ class DataProcessorTest extends RulesKernelTestBase { /** * Tests that the numeric offset plugin works. */ - public function testNumericOffset() { + public function testNumericOffset(): void { // Configure a simple rule with one action. $action = $this->expressionManager->createInstance('rules_action', // @todo Actually the data processor plugin only applies to numbers, so is diff --git a/tests/src/Kernel/Engine/AutocompleteTest.php b/tests/src/Kernel/Engine/AutocompleteTest.php index f1b59f39797976de2108c64111589f4a1d356c38..5e2d36db96e0123c0878caa266a879fe0719c77b 100644 --- a/tests/src/Kernel/Engine/AutocompleteTest.php +++ b/tests/src/Kernel/Engine/AutocompleteTest.php @@ -58,7 +58,7 @@ class AutocompleteTest extends RulesKernelTestBase { /** * Tests autocompletion works for a variable in the metadata state. */ - public function testAutocomplete() { + public function testAutocomplete(): void { $rule = $this->expressionManager->createRule(); $action = $this->expressionManager->createAction('rules_data_set'); $rule->addExpressionObject($action); @@ -82,7 +82,7 @@ class AutocompleteTest extends RulesKernelTestBase { /** * Test various node example data selectors. */ - public function testNodeAutocomplete() { + public function testNodeAutocomplete(): void { $rule = $this->expressionManager->createRule(); $rule->addAction('rules_data_set'); @@ -340,7 +340,7 @@ class AutocompleteTest extends RulesKernelTestBase { /** * Tests that autocomplete results for a flat list are correct. */ - public function testListAutocomplete() { + public function testListAutocomplete(): void { $rule = $this->expressionManager->createRule(); $rule->addAction('rules_data_set'); diff --git a/tests/src/Kernel/Engine/MetadataAssertionTest.php b/tests/src/Kernel/Engine/MetadataAssertionTest.php index e8df4e66718172b15b9f27248aaa193ee22a4a3a..39ba72bfa977661c444be5ca395ff67f637fa426 100644 --- a/tests/src/Kernel/Engine/MetadataAssertionTest.php +++ b/tests/src/Kernel/Engine/MetadataAssertionTest.php @@ -67,7 +67,7 @@ class MetadataAssertionTest extends RulesKernelTestBase { /** * Tests asserting metadata using the EntityIfOfBundle condition. */ - public function testAssertingEntityBundle() { + public function testAssertingEntityBundle(): void { // When trying to use the field_text field without knowledge of the bundle, // the field is not available. $rule = $this->expressionManager->createRule(); @@ -99,7 +99,7 @@ class MetadataAssertionTest extends RulesKernelTestBase { /** * Tests asserted metadata is handled correctly in OR and AND containers. */ - public function testAssertingWithLogicalOperations() { + public function testAssertingWithLogicalOperations(): void { // Add an nested AND and make sure it keeps working. $rule = $this->expressionManager->createRule(); $and = $this->expressionManager->createAnd(); @@ -140,7 +140,7 @@ class MetadataAssertionTest extends RulesKernelTestBase { /** * Tests asserted metadata of negated conditions is ignored. */ - public function testAssertingOfNegatedConditions() { + public function testAssertingOfNegatedConditions(): void { // Negate the condition only and make sure it is ignored. $rule = $this->expressionManager->createRule(); $rule->addCondition('rules_entity_is_of_bundle', ContextConfig::create() diff --git a/tests/src/Kernel/EntityViewTest.php b/tests/src/Kernel/EntityViewTest.php index f136844d916be885585e03a5f4b0d2ee885e460f..e4404d4a19bf1b589aef7599a6d7cf0834bc8fa7 100644 --- a/tests/src/Kernel/EntityViewTest.php +++ b/tests/src/Kernel/EntityViewTest.php @@ -32,7 +32,7 @@ class EntityViewTest extends RulesKernelTestBase { /** * Tests that rules_entity_view() can be invoked correctly. */ - public function testEntityViewHook() { + public function testEntityViewHook(): void { // Create a node. $entity_type_manager = $this->container->get('entity_type.manager'); $entity_type_manager->getStorage('node_type') diff --git a/tests/src/Kernel/EventIntegrationTest.php b/tests/src/Kernel/EventIntegrationTest.php index e510e291fb94b1813770676c2bbd96bcc97e602e..1d5aa7b6d58ee14b00c3567fb20f52791d7d506c 100644 --- a/tests/src/Kernel/EventIntegrationTest.php +++ b/tests/src/Kernel/EventIntegrationTest.php @@ -46,7 +46,7 @@ class EventIntegrationTest extends RulesKernelTestBase { /** * Test that the user login hook triggers the Rules event listener. */ - public function testUserLoginEvent() { + public function testUserLoginEvent(): void { $rule = $this->expressionManager->createRule(); $rule->addCondition('rules_test_true'); $rule->addAction('rules_test_debug_log', @@ -76,7 +76,7 @@ class EventIntegrationTest extends RulesKernelTestBase { /** * Test that the user logout hook triggers the Rules event listener. */ - public function testUserLogoutEvent() { + public function testUserLogoutEvent(): void { $rule = $this->expressionManager->createRule(); $rule->addCondition('rules_test_true'); $rule->addAction('rules_test_debug_log'); @@ -103,7 +103,7 @@ class EventIntegrationTest extends RulesKernelTestBase { /** * Test that the cron hook triggers the Rules event listener. */ - public function testCronEvent() { + public function testCronEvent(): void { $rule = $this->expressionManager->createRule(); $rule->addCondition('rules_test_true'); $rule->addAction('rules_test_debug_log'); @@ -129,7 +129,7 @@ class EventIntegrationTest extends RulesKernelTestBase { /** * Test that a Logger message triggers the Rules debug logger listener. */ - public function testSystemLoggerEvent() { + public function testSystemLoggerEvent(): void { $rule = $this->expressionManager->createRule(); $rule->addCondition('rules_test_true'); $rule->addAction('rules_test_debug_log'); @@ -156,7 +156,7 @@ class EventIntegrationTest extends RulesKernelTestBase { /** * Test that Drupal initializing triggers the Rules debug logger listener. */ - public function testInitEvent() { + public function testInitEvent(): void { $rule = $this->expressionManager->createRule(); $rule->addCondition('rules_test_true'); $rule->addAction('rules_test_debug_log'); @@ -192,7 +192,7 @@ class EventIntegrationTest extends RulesKernelTestBase { /** * Test that Drupal terminating triggers the Rules debug logger listener. */ - public function testTerminateEvent() { + public function testTerminateEvent(): void { $rule = $this->expressionManager->createRule(); $rule->addCondition('rules_test_true'); $rule->addAction('rules_test_debug_log'); @@ -228,7 +228,7 @@ class EventIntegrationTest extends RulesKernelTestBase { /** * Test that rules config supports multiple events. */ - public function testMultipleEvents() { + public function testMultipleEvents(): void { $rule = $this->expressionManager->createRule(); $rule->addCondition('rules_test_true'); $rule->addAction('rules_test_debug_log'); @@ -267,7 +267,7 @@ class EventIntegrationTest extends RulesKernelTestBase { * * @dataProvider providerTestEntityOriginal */ - public function testEntityOriginal($event_name) { + public function testEntityOriginal(string $event_name): void { // Create a node that we will change and save later. $entity_type_manager = $this->container->get('entity_type.manager'); $entity_type_manager->getStorage('node_type') @@ -325,7 +325,7 @@ class EventIntegrationTest extends RulesKernelTestBase { /** * Tests that entity events are fired for the correct bundle. */ - public function testBundleQualifiedEvents() { + public function testBundleQualifiedEvents(): void { // Create an article node type and a page node type. $entity_type_manager = $this->container->get('entity_type.manager'); $entity_type_manager->getStorage('node_type')->create([ diff --git a/tests/src/Kernel/RedirectEventSubscriberTest.php b/tests/src/Kernel/RedirectEventSubscriberTest.php index c75465205fb651a2e5f65a7f202b0ed9adf57b42..858240bd3dd6872dff7ba45689e5e2bd44963310 100644 --- a/tests/src/Kernel/RedirectEventSubscriberTest.php +++ b/tests/src/Kernel/RedirectEventSubscriberTest.php @@ -19,7 +19,7 @@ class RedirectEventSubscriberTest extends RulesKernelTestBase { * * @covers ::checkRedirectIssued */ - public function testCheckRedirectIssued() { + public function testCheckRedirectIssued(): void { /** @var \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel */ $http_kernel = $this->container->get('http_kernel'); diff --git a/tests/src/Kernel/RulesEmailTest.php b/tests/src/Kernel/RulesEmailTest.php index ae6a9a2798ea8d30c4441f436fdae1e9e4f84642..3c351da0f1b9bca00a5604c6fe4fa6f5b17bff25 100644 --- a/tests/src/Kernel/RulesEmailTest.php +++ b/tests/src/Kernel/RulesEmailTest.php @@ -40,7 +40,7 @@ class RulesEmailTest extends RulesKernelTestBase { /** * Checks the From: and Reply-to: headers. */ - public function testSubjectAndBody() { + public function testSubjectAndBody(): void { // Create action to send email. $action = $this->actionManager->createInstance('rules_send_email'); diff --git a/tests/src/Kernel/RulesEngineTest.php b/tests/src/Kernel/RulesEngineTest.php index 597d8fdd31448fbbe3a85fe5b7844049ebd91e04..b7b82769438f75577e08ca95bb5ac61bb4458c30 100644 --- a/tests/src/Kernel/RulesEngineTest.php +++ b/tests/src/Kernel/RulesEngineTest.php @@ -34,7 +34,7 @@ class RulesEngineTest extends RulesKernelTestBase { /** * Tests creating a rule and iterating over the rule elements. */ - public function testRuleCreation() { + public function testRuleCreation(): void { // Create an 'and' condition container and add conditions to it. $and = $this->expressionManager->createAnd() ->addCondition('rules_test_false') @@ -75,7 +75,7 @@ class RulesEngineTest extends RulesKernelTestBase { /** * Tests passing a string context to a condition. */ - public function testContextPassing() { + public function testContextPassing(): void { $rule = $this->expressionManager->createRule(); $rule->addCondition('rules_test_string_condition', ContextConfig::create() @@ -95,7 +95,7 @@ class RulesEngineTest extends RulesKernelTestBase { /** * Tests that a condition can provide a value and another one can consume it. */ - public function testProvidedVariables() { + public function testProvidedVariables(): void { $rule = $this->expressionManager->createRule(); // The first condition provides a "provided_text" variable. @@ -120,7 +120,7 @@ class RulesEngineTest extends RulesKernelTestBase { /** * Tests that provided variables can be renamed with configuration. */ - public function testRenamingOfProvidedVariables() { + public function testRenamingOfProvidedVariables(): void { $rule = $this->expressionManager->createRule(); // The condition provides a "provided_text" variable. @@ -139,7 +139,7 @@ class RulesEngineTest extends RulesKernelTestBase { /** * Tests that multiple actions can consume and provide context variables. */ - public function testActionProvidedContext() { + public function testActionProvidedContext(): void { // @todo Convert the test to make use of actions instead of conditions. $rule = $this->expressionManager->createRule(); @@ -171,7 +171,7 @@ class RulesEngineTest extends RulesKernelTestBase { /** * Verifies swapping out core services works. */ - public function testSwappedCoreServices() { + public function testSwappedCoreServices(): void { $condition_manager = $this->container->get('plugin.manager.condition'); $this->assertInstanceOf(ConditionManager::class, $condition_manager); } diff --git a/tests/src/Kernel/RulesKernelTestBase.php b/tests/src/Kernel/RulesKernelTestBase.php index 3b76009d27919a064f029812fb289e8195b15f6a..6d9e3477ca0010e92ee95738d036a5d391c0bca0 100644 --- a/tests/src/Kernel/RulesKernelTestBase.php +++ b/tests/src/Kernel/RulesKernelTestBase.php @@ -3,6 +3,7 @@ namespace Drupal\Tests\rules\Kernel; use Drupal\KernelTests\KernelTestBase; +use Drupal\rules\Core\RulesConditionInterface; /** * Base class for Rules Drupal unit tests. @@ -103,7 +104,7 @@ abstract class RulesKernelTestBase extends KernelTestBase { * @return \Drupal\rules\Core\RulesConditionInterface * The created condition plugin. */ - protected function createCondition($id) { + protected function createCondition(string $id): RulesConditionInterface { $condition = $this->expressionManager->createInstance('rules_condition', [ 'condition_id' => $id, ]); @@ -118,7 +119,7 @@ abstract class RulesKernelTestBase extends KernelTestBase { * @param int $log_item_index * Log item's index in log entries stack. */ - protected function assertRulesDebugLogEntryExists($message, $log_item_index = 0) { + protected function assertRulesDebugLogEntryExists(string $message, int $log_item_index = 0): void { // Test that the action has logged something. $logs = $this->debugLog->getLogs(); $this->assertEquals($logs[$log_item_index]['message'], $message); @@ -130,7 +131,7 @@ abstract class RulesKernelTestBase extends KernelTestBase { * @param string $message * Log message. */ - protected function assertRulesDebugLogEntryNotExists($message) { + protected function assertRulesDebugLogEntryNotExists(string $message): void { // Check each log entry. $logs = $this->debugLog->getLogs(); foreach ($logs as $log) { diff --git a/tests/src/Kernel/RulesUiEmbedTest.php b/tests/src/Kernel/RulesUiEmbedTest.php index f87d6e89babc18ffbe9acdd38e8e9c48b6d54683..bc31ef93661ea9152a5d9b8b292f9630d20a216f 100644 --- a/tests/src/Kernel/RulesUiEmbedTest.php +++ b/tests/src/Kernel/RulesUiEmbedTest.php @@ -45,7 +45,7 @@ class RulesUiEmbedTest extends RulesKernelTestBase { /** * @covers \Drupal\rules\Ui\RulesUiManager */ - public function testUiManager() { + public function testUiManager(): void { $definition = $this->rulesUiManager->getDefinitions(); $this->assertArrayHasKey('rules_test_ui_embed.settings_conditions', $definition); $this->assertInstanceOf(RulesUiDefinition::class, $definition['rules_test_ui_embed.settings_conditions']); diff --git a/tests/src/Kernel/TokenIntegrationTest.php b/tests/src/Kernel/TokenIntegrationTest.php index 945f259a35b390c86ba01cffa5f46195057910be..a05115855c688a1366ba85a483c0fd6691a88df4 100644 --- a/tests/src/Kernel/TokenIntegrationTest.php +++ b/tests/src/Kernel/TokenIntegrationTest.php @@ -17,7 +17,7 @@ class TokenIntegrationTest extends RulesKernelTestBase { /** * Tests that date tokens are formatted correctly. */ - public function testSystemDateToken() { + public function testSystemDateToken(): void { // Configure a simple rule with one action. and token replacements enabled. $action = $this->expressionManager->createInstance('rules_action', ContextConfig::create() @@ -45,7 +45,7 @@ class TokenIntegrationTest extends RulesKernelTestBase { /** * Tests that global context variable tokens are replaced correctly. */ - public function testGlobalContextVariableTokens() { + public function testGlobalContextVariableTokens(): void { // Configure a simple rule with one action and token replacements enabled. $action = $this->expressionManager->createInstance('rules_action', ContextConfig::create() diff --git a/tests/src/Unit/ActionSetExpressionTest.php b/tests/src/Unit/ActionSetExpressionTest.php index 3e31ae53665150282b464ba59144a4a50c3b1014..61f380698f0309d14ef9fdc05eb8a3ccdd251195 100644 --- a/tests/src/Unit/ActionSetExpressionTest.php +++ b/tests/src/Unit/ActionSetExpressionTest.php @@ -34,7 +34,7 @@ class ActionSetExpressionTest extends RulesUnitTestBase { /** * Tests that an action in the set fires. */ - public function testActionExecution() { + public function testActionExecution(): void { // The execute method on the test action must be called once. $this->testActionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -45,7 +45,7 @@ class ActionSetExpressionTest extends RulesUnitTestBase { /** * Tests that two actions in the set fire both. */ - public function testTwoActionExecution() { + public function testTwoActionExecution(): void { // The execute method on the test action must be called once. $this->testActionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -65,7 +65,7 @@ class ActionSetExpressionTest extends RulesUnitTestBase { /** * Tests that nested action sets work. */ - public function testNestedActionExecution() { + public function testNestedActionExecution(): void { // The execute method on the test action must be called twice. $this->testActionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(2); @@ -81,7 +81,7 @@ class ActionSetExpressionTest extends RulesUnitTestBase { /** * Tests that a nested action can be retrieved by UUID. */ - public function testLookupAction() { + public function testLookupAction(): void { $this->actionSet->addExpressionObject($this->testActionExpression->reveal()); $uuid = $this->testActionExpression->reveal()->getUuid(); $lookup_action = $this->actionSet->getExpression($uuid); @@ -92,7 +92,7 @@ class ActionSetExpressionTest extends RulesUnitTestBase { /** * Tests deleting an action from the container. */ - public function testDeletingAction() { + public function testDeletingAction(): void { $this->actionSet->addExpressionObject($this->testActionExpression->reveal()); $second_action = $this->prophesize(ActionExpression::class); $this->actionSet->addExpressionObject($second_action->reveal()); @@ -110,7 +110,7 @@ class ActionSetExpressionTest extends RulesUnitTestBase { /** * Tests evaluation order with two actions. */ - public function testEvaluationOrder() { + public function testEvaluationOrder(): void { // The execute method on the second action must be called once. $this->testActionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -147,7 +147,7 @@ class TestActionSetExpression extends ActionSetExpression { /** * {@inheritdoc} */ - public function executeWithState(ExecutionStateInterface $state) { + public function executeWithState(ExecutionStateInterface $state): array { $uuids = []; // Use the iterator to ensure the actions are sorted. foreach ($this as $action) { diff --git a/tests/src/Unit/AndExpressionTest.php b/tests/src/Unit/AndExpressionTest.php index 53817153175e05a2a9b72a4c5dfa462204f6d3ae..2d240069911439940298ac871f86cdc93392343d 100644 --- a/tests/src/Unit/AndExpressionTest.php +++ b/tests/src/Unit/AndExpressionTest.php @@ -32,7 +32,7 @@ class AndExpressionTest extends RulesUnitTestBase { /** * Tests one condition. */ - public function testOneCondition() { + public function testOneCondition(): void { // The method on the test condition must be called once. $this->trueConditionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -44,7 +44,7 @@ class AndExpressionTest extends RulesUnitTestBase { /** * Tests an empty AND. */ - public function testEmptyAnd() { + public function testEmptyAnd(): void { $property = new \ReflectionProperty($this->and, 'conditions'); $property->setAccessible(TRUE); @@ -55,7 +55,7 @@ class AndExpressionTest extends RulesUnitTestBase { /** * Tests two true conditions. */ - public function testTwoConditions() { + public function testTwoConditions(): void { // The method on the test condition must be called once. $this->trueConditionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -78,7 +78,7 @@ class AndExpressionTest extends RulesUnitTestBase { /** * Tests two false conditions. */ - public function testTwoFalseConditions() { + public function testTwoFalseConditions(): void { // The method on the test condition must be called once. $this->falseConditionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -103,7 +103,7 @@ class AndExpressionTest extends RulesUnitTestBase { /** * Tests evaluation order with two conditions. */ - public function testEvaluationOrder() { + public function testEvaluationOrder(): void { // The method on the false test condition must be called once. $this->falseConditionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/ConditionExpressionTest.php b/tests/src/Unit/ConditionExpressionTest.php index 4f80644f20223ec4b7b5fa93f6be3ad4a40ecc39..5d04a4165d885b3dac010a8dce9d41d4f648300e 100644 --- a/tests/src/Unit/ConditionExpressionTest.php +++ b/tests/src/Unit/ConditionExpressionTest.php @@ -80,7 +80,7 @@ class ConditionExpressionTest extends UnitTestCase { /** * Tests that context values get data processed with processor mappings. */ - public function testDataProcessor() { + public function testDataProcessor(): void { $this->conditionManager->createInstance('test_condition', ['negate' => FALSE]) ->willReturn($this->trueCondition->reveal()) ->shouldBeCalledTimes(1); @@ -139,7 +139,7 @@ class ConditionExpressionTest extends UnitTestCase { /** * Tests that negating a condition works. */ - public function testNegation() { + public function testNegation(): void { $this->trueCondition->getContextDefinitions()->willReturn([]); $this->trueCondition->refineContextDefinitions([])->shouldBeCalledTimes(1); $this->trueCondition->getProvidedContextDefinitions() diff --git a/tests/src/Unit/ContextHandlerTraitTest.php b/tests/src/Unit/ContextHandlerTraitTest.php index 68c2025394fa9a612afb1bcbc5ec03fa39637b5f..7159cac5e29a18b9121456501dbe8811248134d7 100644 --- a/tests/src/Unit/ContextHandlerTraitTest.php +++ b/tests/src/Unit/ContextHandlerTraitTest.php @@ -22,7 +22,7 @@ class ContextHandlerTraitTest extends RulesUnitTestBase { * * @covers ::prepareContext */ - public function testMissingContext() { + public function testMissingContext(): void { // Set the expected exception class and message. $this->expectException(EvaluationException::class); $this->expectExceptionMessage("Required context 'test' is missing for plugin 'testplugin'"); diff --git a/tests/src/Unit/Entity/ReactionRuleConfigTest.php b/tests/src/Unit/Entity/ReactionRuleConfigTest.php index 145a760c8dcd9a7537ed2fa0dd9c620bafdab31d..31cc25f79d36e7d73e42c357d780971ec7522b12 100644 --- a/tests/src/Unit/Entity/ReactionRuleConfigTest.php +++ b/tests/src/Unit/Entity/ReactionRuleConfigTest.php @@ -17,7 +17,7 @@ class ReactionRuleConfigTest extends RulesUnitTestBase { * @param array $values * (optional) An array of values to set, keyed by property name. */ - protected function createRule(array $values = []) { + protected function createRule(array $values = []): ReactionRuleConfig { $values += [ 'id' => 'test_rule', ]; @@ -28,7 +28,7 @@ class ReactionRuleConfigTest extends RulesUnitTestBase { /** * @covers ::getEvents */ - public function testGetEvents() { + public function testGetEvents(): void { // Create a rule with a few events. $rule = $this->createRule([ 'events' => [ @@ -47,7 +47,7 @@ class ReactionRuleConfigTest extends RulesUnitTestBase { /** * @covers ::getEventNames */ - public function testGetEventNames() { + public function testGetEventNames(): void { // Create a rule with a few events. $rule = $this->createRule([ 'events' => [ @@ -66,7 +66,7 @@ class ReactionRuleConfigTest extends RulesUnitTestBase { * * @dataProvider addEventDataProvider */ - public function testAddEvent(array $expected, array $events_init, array $event_add) { + public function testAddEvent(array $expected, array $events_init, array $event_add): void { $rule = $this->createRule([ 'events' => $events_init, ]); @@ -119,7 +119,7 @@ class ReactionRuleConfigTest extends RulesUnitTestBase { /** * @covers ::hasEvent */ - public function testHasEvent() { + public function testHasEvent(): void { // Create a rule with a few events. $rule = $this->createRule([ 'events' => [ @@ -138,7 +138,7 @@ class ReactionRuleConfigTest extends RulesUnitTestBase { * @covers ::removeEvent * @covers ::getEvents */ - public function testRemoveEvent() { + public function testRemoveEvent(): void { // Create a rule with a few events. $rule = $this->createRule([ 'events' => [ @@ -154,7 +154,7 @@ class ReactionRuleConfigTest extends RulesUnitTestBase { * @covers ::removeEvent * @covers ::getEvents */ - public function testRemoveEventWithKeyedIndex() { + public function testRemoveEventWithKeyedIndex(): void { // Create a rule with a few events that are numerically indexed. // This situation should not ever happen - the configuration entity // expects that events are numerically indexed and that the indices diff --git a/tests/src/Unit/Integration/Condition/ConditionAccessTest.php b/tests/src/Unit/Integration/Condition/ConditionAccessTest.php index 358e1f0f9d4ba3fd4411ac830cb086d748cf44ce..ccd5945b022d40c80b9f0ef148a2db7eb9fc27c0 100644 --- a/tests/src/Unit/Integration/Condition/ConditionAccessTest.php +++ b/tests/src/Unit/Integration/Condition/ConditionAccessTest.php @@ -16,7 +16,7 @@ class ConditionAccessTest extends RulesIntegrationTestBase { /** * Confirm that a condition plugin respects configure_permissions. */ - public function testHasConfigurationAccessInfo() { + public function testHasConfigurationAccessInfo(): void { $plugin = $this->conditionManager->createInstance('rules_test_string_condition'); $this->assertNotNull($plugin, "The rules_test condition was found."); $definition = $plugin->getPluginDefinition(); diff --git a/tests/src/Unit/Integration/Condition/ConditionManagerTest.php b/tests/src/Unit/Integration/Condition/ConditionManagerTest.php index a6c625eefb81269ba91f505b8a697ccdbd7d24f5..648b4c9b9ddf56de171baf90fcb90b1aed498381 100644 --- a/tests/src/Unit/Integration/Condition/ConditionManagerTest.php +++ b/tests/src/Unit/Integration/Condition/ConditionManagerTest.php @@ -16,7 +16,7 @@ class ConditionManagerTest extends RulesIntegrationTestBase { /** * @covers ::getDiscovery */ - public function testContextDefinitionAnnotations() { + public function testContextDefinitionAnnotations(): void { $definitions = $this->conditionManager->getDefinitions(); // Make sure all context definitions are using the class provided by Rules. foreach ($definitions as $definition) { diff --git a/tests/src/Unit/Integration/Condition/DataComparisonTest.php b/tests/src/Unit/Integration/Condition/DataComparisonTest.php index a2934447c24d76b911c3379c4d8de484876c0b59..04149b1cf42f8f4935e9dd9f8a19ce2067d9d058 100644 --- a/tests/src/Unit/Integration/Condition/DataComparisonTest.php +++ b/tests/src/Unit/Integration/Condition/DataComparisonTest.php @@ -32,7 +32,7 @@ class DataComparisonTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationOperatorEquals() { + public function testConditionEvaluationOperatorEquals(): void { // Test that when a boolean data does not equal a boolean value // and the operator is not set - should fallback to '=='. $this->condition @@ -85,7 +85,7 @@ class DataComparisonTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationOperatorContains() { + public function testConditionEvaluationOperatorContains(): void { // Test that when the data string contains the value string, and the // operation is 'CONTAINS', TRUE is returned. $this->condition @@ -124,7 +124,7 @@ class DataComparisonTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationOperatorIn() { + public function testConditionEvaluationOperatorIn(): void { // Test that when the data string is 'IN' the value array, TRUE is returned. $this->condition ->setContextValue('data', 'Llama') @@ -146,7 +146,7 @@ class DataComparisonTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationOperatorLessThan() { + public function testConditionEvaluationOperatorLessThan(): void { // Test that when data is less than value and operation is '<', // TRUE is returned. $this->condition @@ -169,7 +169,7 @@ class DataComparisonTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationOperatorGreaterThan() { + public function testConditionEvaluationOperatorGreaterThan(): void { // Test that when data is greater than value and operation is '>', // TRUE is returned. $this->condition @@ -192,14 +192,14 @@ class DataComparisonTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Data comparison', $this->condition->summary()); } /** * @covers ::refineContextDefinitions */ - public function testRefineContextDefinitions() { + public function testRefineContextDefinitions(): void { // When a string is selected for comparison, the value must be string also. $this->condition->refineContextDefinitions([ 'data' => DataDefinition::create('string'), diff --git a/tests/src/Unit/Integration/Condition/DataIsEmptyTest.php b/tests/src/Unit/Integration/Condition/DataIsEmptyTest.php index db8a1d912f5e0fb3e82a5801f899474a16d63950..4d99e7301484aee11c6d42ad93e3aaaf0aa0c902 100644 --- a/tests/src/Unit/Integration/Condition/DataIsEmptyTest.php +++ b/tests/src/Unit/Integration/Condition/DataIsEmptyTest.php @@ -33,7 +33,7 @@ class DataIsEmptyTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { // Test a ComplexDataInterface object. $entity_adapter_empty = $this->prophesize(ComplexDataInterface::class); $entity_adapter_empty->isEmpty()->willReturn(TRUE)->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/Condition/EntityHasFieldTest.php b/tests/src/Unit/Integration/Condition/EntityHasFieldTest.php index d4c9f93fc7ddb58a474620f101720bb670d2db05..37216f904002bd0b6bcb107a599fb759ea21c5cc 100644 --- a/tests/src/Unit/Integration/Condition/EntityHasFieldTest.php +++ b/tests/src/Unit/Integration/Condition/EntityHasFieldTest.php @@ -32,7 +32,7 @@ class EntityHasFieldTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { $entity = $this->prophesizeEntity(ContentEntityInterface::class); $entity->hasField('existing-field')->willReturn(TRUE) ->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/Condition/EntityIsNewTest.php b/tests/src/Unit/Integration/Condition/EntityIsNewTest.php index 8a4dda3ddf172dcba75c0ae7857d6b824b55fb0b..62f59cf5ec665bfe76a7b36171ec7f7d0b33e379 100644 --- a/tests/src/Unit/Integration/Condition/EntityIsNewTest.php +++ b/tests/src/Unit/Integration/Condition/EntityIsNewTest.php @@ -31,7 +31,7 @@ class EntityIsNewTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { $entity = $this->prophesizeEntity(EntityInterface::class); $entity->isNew()->willReturn(TRUE)->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/Condition/EntityIsOfBundleTest.php b/tests/src/Unit/Integration/Condition/EntityIsOfBundleTest.php index 04eeea7334ebab3f16150571fd37956a64718558..1d08a834dec27b407bd945b2e1b6c1b96000daae 100644 --- a/tests/src/Unit/Integration/Condition/EntityIsOfBundleTest.php +++ b/tests/src/Unit/Integration/Condition/EntityIsOfBundleTest.php @@ -32,7 +32,7 @@ class EntityIsOfBundleTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { $entity = $this->prophesizeEntity(EntityInterface::class); $entity->getEntityTypeId()->willReturn('node')->shouldBeCalledTimes(3); diff --git a/tests/src/Unit/Integration/Condition/EntityIsOfTypeTest.php b/tests/src/Unit/Integration/Condition/EntityIsOfTypeTest.php index aed8446b11e1fe1503102e81667b302e698df62d..85dd3113793d194ddd15386a83634931c972bf52 100644 --- a/tests/src/Unit/Integration/Condition/EntityIsOfTypeTest.php +++ b/tests/src/Unit/Integration/Condition/EntityIsOfTypeTest.php @@ -32,7 +32,7 @@ class EntityIsOfTypeTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { $entity = $this->prophesizeEntity(EntityInterface::class); $entity->getEntityTypeId()->willReturn('node')->shouldBeCalledTimes(2); diff --git a/tests/src/Unit/Integration/Condition/IpIsBannedTest.php b/tests/src/Unit/Integration/Condition/IpIsBannedTest.php index 85728a75a67e76053f7a5ead907a5dd720a2ddac..dcad861b321cea5c429aea351be7d0b75e0ee98e 100644 --- a/tests/src/Unit/Integration/Condition/IpIsBannedTest.php +++ b/tests/src/Unit/Integration/Condition/IpIsBannedTest.php @@ -65,7 +65,7 @@ class IpIsBannedTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { // Test an IPv4 address that has not been banned; should return FALSE. // TEST-NET-1 IPv4. $ipv4 = '192.0.2.0'; diff --git a/tests/src/Unit/Integration/Condition/ListContainsTest.php b/tests/src/Unit/Integration/Condition/ListContainsTest.php index 766d3bf4e144c8d14aa1d04d0ade8619686d41c3..e7d6d64b8e557b67b9fe57c3e1b97a43aeb0b0aa 100644 --- a/tests/src/Unit/Integration/Condition/ListContainsTest.php +++ b/tests/src/Unit/Integration/Condition/ListContainsTest.php @@ -32,7 +32,7 @@ class ListContainsTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { // Test array of string values. $list = ['One', 'Two', 'Three']; diff --git a/tests/src/Unit/Integration/Condition/ListCountIsTest.php b/tests/src/Unit/Integration/Condition/ListCountIsTest.php index 8b625348424bb3929249a9b4c41ce8ff11b7f017..98cdd1bd9d6b97eb3d627e7b34d4bf959aadd2a6 100644 --- a/tests/src/Unit/Integration/Condition/ListCountIsTest.php +++ b/tests/src/Unit/Integration/Condition/ListCountIsTest.php @@ -31,7 +31,7 @@ class ListCountIsTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { // Test that the list count is greater than 2. $condition = $this->condition ->setContextValue('list', [1, 2, 3, 4]) diff --git a/tests/src/Unit/Integration/Condition/NodeIsOfTypeTest.php b/tests/src/Unit/Integration/Condition/NodeIsOfTypeTest.php index 97650e3aa8dd2b2d7ed31999202496c6162f43ae..8f8a0cae4ee31137d53a408d53381f59ee26735c 100644 --- a/tests/src/Unit/Integration/Condition/NodeIsOfTypeTest.php +++ b/tests/src/Unit/Integration/Condition/NodeIsOfTypeTest.php @@ -33,7 +33,7 @@ class NodeIsOfTypeTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { $node = $this->prophesizeEntity(NodeInterface::class); $node->getType()->willReturn('page'); diff --git a/tests/src/Unit/Integration/Condition/NodeIsPromotedTest.php b/tests/src/Unit/Integration/Condition/NodeIsPromotedTest.php index 98f224ba8d2dde489bf19aeb3f1482ecc1dafd79..68faf437102151f44ecafe5cd092980b311621d8 100644 --- a/tests/src/Unit/Integration/Condition/NodeIsPromotedTest.php +++ b/tests/src/Unit/Integration/Condition/NodeIsPromotedTest.php @@ -35,7 +35,7 @@ class NodeIsPromotedTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { $promoted_node = $this->prophesizeEntity(NodeInterface::class); $promoted_node->isPromoted()->willReturn(TRUE)->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/Condition/NodeIsPublishedTest.php b/tests/src/Unit/Integration/Condition/NodeIsPublishedTest.php index 88d653bfeac634df85be1b8efecec806c6719192..d0dad0456b64c227f3f2db03c240e819aac056bd 100644 --- a/tests/src/Unit/Integration/Condition/NodeIsPublishedTest.php +++ b/tests/src/Unit/Integration/Condition/NodeIsPublishedTest.php @@ -33,7 +33,7 @@ class NodeIsPublishedTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { $published_node = $this->prophesizeEntity(NodeInterface::class); $published_node->isPublished()->willReturn(TRUE)->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/Condition/NodeIsStickyTest.php b/tests/src/Unit/Integration/Condition/NodeIsStickyTest.php index 9857423238dfdca2988bd3d783b46d5c575c3078..3f1347da81866293fbfc8a88016907d1e4a678d4 100644 --- a/tests/src/Unit/Integration/Condition/NodeIsStickyTest.php +++ b/tests/src/Unit/Integration/Condition/NodeIsStickyTest.php @@ -33,7 +33,7 @@ class NodeIsStickyTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { $sticky_node = $this->prophesizeEntity(NodeInterface::class); $sticky_node->isSticky()->willReturn(TRUE)->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/Condition/PathAliasExistsTest.php b/tests/src/Unit/Integration/Condition/PathAliasExistsTest.php index 3d4de5c9a62aced5b39154fb075c6de184b33c99..a7dc8723dedebd7f1b775ce37222d94ff13f9d31 100644 --- a/tests/src/Unit/Integration/Condition/PathAliasExistsTest.php +++ b/tests/src/Unit/Integration/Condition/PathAliasExistsTest.php @@ -52,7 +52,7 @@ class PathAliasExistsTest extends RulesIntegrationTestBase { * * @covers ::__construct */ - public function testConstructor() { + public function testConstructor(): void { $property = new \ReflectionProperty($this->condition, 'aliasManager'); $property->setAccessible(TRUE); @@ -64,7 +64,7 @@ class PathAliasExistsTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationAliasWithPath() { + public function testConditionEvaluationAliasWithPath(): void { // If the path exists, getPathByAlias() should return the path. $this->aliasManager->getPathByAlias('/alias-for-path', NULL) ->willReturn('/path-with-alias') @@ -92,7 +92,7 @@ class PathAliasExistsTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationAliasWithoutPath() { + public function testConditionEvaluationAliasWithoutPath(): void { // If the path does not exist, getPathByAlias() should return the alias. $this->aliasManager->getPathByAlias('/alias-for-path-that-does-not-exist', NULL) ->willReturn('/alias-for-path-that-does-not-exist') diff --git a/tests/src/Unit/Integration/Condition/PathHasAliasTest.php b/tests/src/Unit/Integration/Condition/PathHasAliasTest.php index 8d5a8a848fb2a3fccc0628b697763a97708a84b2..333817bd539b747faca98f28c43892db83a99560 100644 --- a/tests/src/Unit/Integration/Condition/PathHasAliasTest.php +++ b/tests/src/Unit/Integration/Condition/PathHasAliasTest.php @@ -52,7 +52,7 @@ class PathHasAliasTest extends RulesIntegrationTestBase { * * @covers ::__construct */ - public function testConstructor() { + public function testConstructor(): void { $property = new \ReflectionProperty($this->condition, 'aliasManager'); $property->setAccessible(TRUE); @@ -64,7 +64,7 @@ class PathHasAliasTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationPathWithAlias() { + public function testConditionEvaluationPathWithAlias(): void { // If the alias exists, getAliasByPath() should return the alias. $this->aliasManager->getAliasByPath('/path-with-alias', NULL) ->willReturn('/alias-for-path') @@ -90,7 +90,7 @@ class PathHasAliasTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationPathWithoutAlias() { + public function testConditionEvaluationPathWithoutAlias(): void { // If the alias does not exist, getAliasByPath() should return the path. $this->aliasManager->getAliasByPath('/path-without-alias', NULL) ->willReturn('/path-without-alias') diff --git a/tests/src/Unit/Integration/Condition/TextComparisonTest.php b/tests/src/Unit/Integration/Condition/TextComparisonTest.php index f7aeba81b3efeda6376dcc56fff3be1b66027d7f..e9bda415f79b0372602f19f2b854876cb53a02dd 100644 --- a/tests/src/Unit/Integration/Condition/TextComparisonTest.php +++ b/tests/src/Unit/Integration/Condition/TextComparisonTest.php @@ -33,7 +33,7 @@ class TextComparisonTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationOperatorStarts() { + public function testConditionEvaluationOperatorStarts(): void { // Test that when the text string starts with the match string and // the operator is 'starts', TRUE is returned. $this->condition @@ -56,7 +56,7 @@ class TextComparisonTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationOperatorEnds() { + public function testConditionEvaluationOperatorEnds(): void { // Test that when the text string ends with the match string and // the operator is 'ends', TRUE is returned. $this->condition @@ -79,7 +79,7 @@ class TextComparisonTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationOperatorContains() { + public function testConditionEvaluationOperatorContains(): void { // Test that when the text string contains the match string and // the operator is 'contains', TRUE is returned. $this->condition @@ -102,7 +102,7 @@ class TextComparisonTest extends RulesIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluationOperatorRegex() { + public function testConditionEvaluationOperatorRegex(): void { // Test that when the operator is 'regex' and the regular expression in // the match string matches the text string, TRUE is returned. $this->condition @@ -125,7 +125,7 @@ class TextComparisonTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Text comparison', $this->condition->summary()); } diff --git a/tests/src/Unit/Integration/Condition/UserHasEntityFieldAccessTest.php b/tests/src/Unit/Integration/Condition/UserHasEntityFieldAccessTest.php index 44b2110e613ac602d5d7154ba5d30773f4c5012e..418b8199e4d1c96787f2492230ce5884f311a0d0 100644 --- a/tests/src/Unit/Integration/Condition/UserHasEntityFieldAccessTest.php +++ b/tests/src/Unit/Integration/Condition/UserHasEntityFieldAccessTest.php @@ -36,7 +36,7 @@ class UserHasEntityFieldAccessTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { $account = $this->prophesizeEntity(UserInterface::class); $entity = $this->prophesizeEntity(ContentEntityInterface::class); $items = $this->prophesize(FieldItemListInterface::class); diff --git a/tests/src/Unit/Integration/Condition/UserHasRoleTest.php b/tests/src/Unit/Integration/Condition/UserHasRoleTest.php index c61a69317879725b3eab39abbb2ce6d7e33d56e2..56c2f07e79dc5daaeb3c90bf7521007271f8ce3f 100644 --- a/tests/src/Unit/Integration/Condition/UserHasRoleTest.php +++ b/tests/src/Unit/Integration/Condition/UserHasRoleTest.php @@ -35,7 +35,7 @@ class UserHasRoleTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { // Set-up a mock object with roles 'authenticated' and 'editor', but not // 'administrator'. $account = $this->prophesizeEntity(UserInterface::class); @@ -89,7 +89,7 @@ class UserHasRoleTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testInvalidOperationException() { + public function testInvalidOperationException(): void { // Set the expected exception class and message. $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Either use "AND" or "OR". Leave empty for default "AND" behavior.'); diff --git a/tests/src/Unit/Integration/Condition/UserIsBlockedTest.php b/tests/src/Unit/Integration/Condition/UserIsBlockedTest.php index f5e6c406daa8874916ce22c10858bf047d030ad2..fb8f52a264d4c3a683141e32eb31ffd8ddc6b3cc 100644 --- a/tests/src/Unit/Integration/Condition/UserIsBlockedTest.php +++ b/tests/src/Unit/Integration/Condition/UserIsBlockedTest.php @@ -33,7 +33,7 @@ class UserIsBlockedTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testConditionEvaluation() { + public function testConditionEvaluation(): void { $blocked_user = $this->prophesizeEntity(UserInterface::class); $blocked_user->isBlocked()->willReturn(TRUE)->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/ContributedPluginDiscoveryTest.php b/tests/src/Unit/Integration/ContributedPluginDiscoveryTest.php index 451b5696666b209bdad38620bea49ef3df0586d7..84c166d89357064d13d6f85ae9c78389e1acad5b 100644 --- a/tests/src/Unit/Integration/ContributedPluginDiscoveryTest.php +++ b/tests/src/Unit/Integration/ContributedPluginDiscoveryTest.php @@ -38,7 +38,7 @@ class ContributedPluginDiscoveryTest extends RulesEntityIntegrationTestBase { * * @covers ::evaluate */ - public function testPluginDiscovery() { + public function testPluginDiscovery(): void { $this->assertTrue($this->condition->evaluate()); } diff --git a/tests/src/Unit/Integration/Engine/AnnotationProcessingTest.php b/tests/src/Unit/Integration/Engine/AnnotationProcessingTest.php index e9831b6364651f3530e34fb8f61085b6cb033015..d84fffefb1f4c39603737f3d757181c8fb381c9f 100644 --- a/tests/src/Unit/Integration/Engine/AnnotationProcessingTest.php +++ b/tests/src/Unit/Integration/Engine/AnnotationProcessingTest.php @@ -27,7 +27,7 @@ class AnnotationProcessingTest extends RulesIntegrationTestBase { /** * Make sure @ Translation annotations do not leak out into the wild. */ - public function testTranslationSquelching() { + public function testTranslationSquelching(): void { // Get a sample Rules plugin. $plugin = $this->conditionManager->createInstance('rules_list_contains'); $context = $plugin->getContext('list'); @@ -63,7 +63,7 @@ class AnnotationProcessingTest extends RulesIntegrationTestBase { * * @dataProvider provideRulesPlugins */ - public function testCheckConfiguration($plugin_type, $plugin_id, $context_name, $expected) { + public function testCheckConfiguration(string $plugin_type, string $plugin_id, string $context_name, string $expected): void { $plugin = NULL; switch ($plugin_type) { diff --git a/tests/src/Unit/Integration/Engine/AutoSaveTest.php b/tests/src/Unit/Integration/Engine/AutoSaveTest.php index a06f1d5c4b1864501f6981cbe79841447146a845..a131207ed1f92212026543d7ec188c4b80d9d408 100644 --- a/tests/src/Unit/Integration/Engine/AutoSaveTest.php +++ b/tests/src/Unit/Integration/Engine/AutoSaveTest.php @@ -18,7 +18,7 @@ class AutoSaveTest extends RulesEntityIntegrationTestBase { /** * Tests auto saving after an action execution. */ - public function testActionAutoSave() { + public function testActionAutoSave(): void { $rule = $this->rulesExpressionManager->createRule(); // Just leverage the entity save action, which by default uses auto-saving. $rule->addAction('rules_entity_save', ContextConfig::create() diff --git a/tests/src/Unit/Integration/Engine/ExpressionSerializationTest.php b/tests/src/Unit/Integration/Engine/ExpressionSerializationTest.php index 21ca8f34e19270797b25fb4c6fb453cc23dbe5ac..f6d99563189e7cec12202643497d2a4d2a416fda 100644 --- a/tests/src/Unit/Integration/Engine/ExpressionSerializationTest.php +++ b/tests/src/Unit/Integration/Engine/ExpressionSerializationTest.php @@ -18,7 +18,7 @@ class ExpressionSerializationTest extends RulesIntegrationTestBase { /** * Tests serializing action expressions. */ - public function testActionExpressionSerialization() { + public function testActionExpressionSerialization(): void { $action = $this->rulesExpressionManager ->createAction('rules_test_string', ContextConfig::create() ->setValue('text', 'test') @@ -35,7 +35,7 @@ class ExpressionSerializationTest extends RulesIntegrationTestBase { /** * Tests serializing condition expressions. */ - public function testConditionExpressionSerialization() { + public function testConditionExpressionSerialization(): void { $condition = $this->rulesExpressionManager ->createCondition('rules_test_false'); $serialized_expression = serialize($condition); @@ -48,7 +48,7 @@ class ExpressionSerializationTest extends RulesIntegrationTestBase { /** * Tests condition container base class serialization. */ - public function testConditionContainerExpressionSerialization() { + public function testConditionContainerExpressionSerialization(): void { $expression = $this->rulesExpressionManager ->createAnd(); $expression->addCondition('rules_test_false'); @@ -62,7 +62,7 @@ class ExpressionSerializationTest extends RulesIntegrationTestBase { /** * Tests action container base class serialization. */ - public function testActionContainerExpressionSerialization() { + public function testActionContainerExpressionSerialization(): void { $expression = $this->rulesExpressionManager ->createInstance('rules_action_set'); $expression->addAction('rules_test_string', ContextConfig::create() @@ -79,7 +79,7 @@ class ExpressionSerializationTest extends RulesIntegrationTestBase { /** * Tests rule serialization. */ - public function testRuleExpressionSerialization() { + public function testRuleExpressionSerialization(): void { $expression = $this->rulesExpressionManager ->createRule(); $expression->addAction('rules_test_string', ContextConfig::create() diff --git a/tests/src/Unit/Integration/Engine/IntegrityCheckTest.php b/tests/src/Unit/Integration/Engine/IntegrityCheckTest.php index 8be3a8bc417fb70fbd28e88f180009995ba02689..96ba8ddb27441aabea9093225064a24a6c6fdabd 100644 --- a/tests/src/Unit/Integration/Engine/IntegrityCheckTest.php +++ b/tests/src/Unit/Integration/Engine/IntegrityCheckTest.php @@ -20,7 +20,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that the integrity check can be invoked. */ - public function testIntegrityCheck() { + public function testIntegrityCheck(): void { $rule = $this->rulesExpressionManager->createRule(); $rule->addAction('rules_entity_save', ContextConfig::create() ->map('entity', 'entity') @@ -35,7 +35,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that a wrongly configured variable name triggers a violation. */ - public function testUnknownVariable() { + public function testUnknownVariable(): void { $rule = $this->rulesExpressionManager->createRule(); $action = $this->rulesExpressionManager->createAction('rules_entity_save', ContextConfig::create() ->map('entity', 'unknown_variable') @@ -57,7 +57,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that the integrity check with UUID works. */ - public function testCheckUuid() { + public function testCheckUuid(): void { $rule = $this->rulesExpressionManager->createRule(); // Just use a rule with 2 dummy actions. $rule->addAction('rules_entity_save', ContextConfig::create() @@ -87,7 +87,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that an invalid condition plugin ID results in a violation. */ - public function testInvalidCondition() { + public function testInvalidCondition(): void { $rule = $this->rulesExpressionManager->createRule(); $condition = $this->rulesExpressionManager->createCondition('invalid_condition_id'); $rule->addExpressionObject($condition); @@ -101,7 +101,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that a missing condition plugin ID results in a violation. */ - public function testMissingCondition() { + public function testMissingCondition(): void { $rule = $this->rulesExpressionManager->createRule(); $condition = $this->rulesExpressionManager->createCondition(''); $rule->addExpressionObject($condition); @@ -115,7 +115,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that an invalid action plugin ID results in a violation. */ - public function testInvalidAction() { + public function testInvalidAction(): void { $rule = $this->rulesExpressionManager->createRule(); $action = $this->rulesExpressionManager->createAction('invalid_action_id'); $rule->addExpressionObject($action); @@ -129,7 +129,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that a missing action plugin ID results in a violation. */ - public function testMissingAction() { + public function testMissingAction(): void { $rule = $this->rulesExpressionManager->createRule(); $action = $this->rulesExpressionManager->createAction(''); $rule->addExpressionObject($action); @@ -143,7 +143,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests invalid characters in provided variables. */ - public function testInvalidProvidedName() { + public function testInvalidProvidedName(): void { $rule = $this->rulesExpressionManager->createRule(); // The condition provides a "provided_text" variable. @@ -165,7 +165,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests the input restriction on contexts. */ - public function testInputRestriction() { + public function testInputRestriction(): void { $rule = $this->rulesExpressionManager->createRule(); $action = $this->rulesExpressionManager->createAction('rules_entity_fetch_by_id', ContextConfig::create() @@ -190,7 +190,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests the data selector restriction on contexts. */ - public function testSelectorRestriction() { + public function testSelectorRestriction(): void { $rule = $this->rulesExpressionManager->createRule(); $action = $this->rulesExpressionManager->createAction('rules_data_set', ContextConfig::create() @@ -214,7 +214,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that a primitive context is assigned something that matches. */ - public function testPrimitiveTypeViolation() { + public function testPrimitiveTypeViolation(): void { $rule = $this->rulesExpressionManager->createRule(); // The condition expects a string but we pass a list, which will trigger the @@ -238,7 +238,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that a list context is assigned something that matches. */ - public function testListTypeViolation() { + public function testListTypeViolation(): void { $rule = $this->rulesExpressionManager->createRule(); // The condition expects a list for the type context but we pass a node @@ -263,7 +263,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that a complex data context is assigned something that matches. */ - public function testComplexTypeViolation() { + public function testComplexTypeViolation(): void { $rule = $this->rulesExpressionManager->createRule(); // The condition expects a node context but gets a list instead which cause @@ -288,7 +288,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that an absent required context triggers a violation. */ - public function testMissingRequiredContext() { + public function testMissingRequiredContext(): void { $rule = $this->rulesExpressionManager->createRule(); // The condition is completely un-configured, missing 2 required contexts. @@ -313,7 +313,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Make sure that nested expression violations have the correct UUID. */ - public function testNestedExpressionUuids() { + public function testNestedExpressionUuids(): void { $rule = $this->rulesExpressionManager->createRule(); $action_set = $this->rulesExpressionManager->createInstance('rules_action_set'); // The most inner action will trigger a violation for an unknown variable. @@ -333,7 +333,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests using provided variables in sub-sequent actions passes checks. */ - public function testUsingProvidedVariables() { + public function testUsingProvidedVariables(): void { $rule = $this->rulesExpressionManager->createRule(); $rule->addAction('rules_variable_add', ContextConfig::create() @@ -353,7 +353,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests that refined context is respected when checking context. */ - public function testRefinedContextViolation() { + public function testRefinedContextViolation(): void { $rule = $this->rulesExpressionManager->createRule(); $rule->addAction('rules_variable_add', ContextConfig::create() ->setValue('type', 'integer') @@ -369,7 +369,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests context can be refined based upon mapped context. */ - public function testRefiningContextBasedOnMappedContext() { + public function testRefiningContextBasedOnMappedContext(): void { // DataComparison condition refines context based on selected data. Thus // it for the test and ensure checking integrity passes when the comparison // value is of a compatible type and fails else. @@ -395,7 +395,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase { /** * Tests using provided variables with refined context. */ - public function testUsingRefinedProvidedVariables() { + public function testUsingRefinedProvidedVariables(): void { $rule = $this->rulesExpressionManager->createRule(); $rule->addAction('rules_variable_add', ContextConfig::create() diff --git a/tests/src/Unit/Integration/Engine/LoopTest.php b/tests/src/Unit/Integration/Engine/LoopTest.php index d5a92eb3f9bbf34ab1da8b3c3837b1de1dcdf640..1b47ec72fb94d099d4d3a43d6598b7826fdfb325 100644 --- a/tests/src/Unit/Integration/Engine/LoopTest.php +++ b/tests/src/Unit/Integration/Engine/LoopTest.php @@ -29,7 +29,7 @@ class LoopTest extends RulesEntityIntegrationTestBase { /** * Tests that list items in the loop can be used during execution. */ - public function testListItemUsage() { + public function testListItemUsage(): void { // The rule contains a list of strings that will be concatenated into one // variable. $rule = $this->rulesExpressionManager->createRule(); @@ -62,7 +62,7 @@ class LoopTest extends RulesEntityIntegrationTestBase { /** * Tests that list items can be renamed for usage in nested loops. */ - public function testListItemRenaming() { + public function testListItemRenaming(): void { // The rule contains a list of strings that will be concatenated into one // variable. $rule = $this->rulesExpressionManager->createRule(); @@ -109,7 +109,7 @@ class LoopTest extends RulesEntityIntegrationTestBase { /** * Tests that a list can be chosen with a property path selector. */ - public function testPropertyPathList() { + public function testPropertyPathList(): void { $rule = $this->rulesExpressionManager->createRule(); $rule->addAction('rules_variable_add', ContextConfig::create() ->setValue('type', 'string') @@ -160,7 +160,7 @@ class LoopTest extends RulesEntityIntegrationTestBase { /** * Test the integrity check for loop item names that conflict with others. */ - public function testItemNameConflict() { + public function testItemNameConflict(): void { $rule = $this->rulesExpressionManager->createRule(); $loop = $this->rulesExpressionManager->createInstance('rules_loop', [ @@ -185,7 +185,7 @@ class LoopTest extends RulesEntityIntegrationTestBase { /** * Tests that the specified list variable exists in the execution state. */ - public function testListExists() { + public function testListExists(): void { $rule = $this->rulesExpressionManager->createRule(); $loop = $this->rulesExpressionManager->createInstance('rules_loop', [ @@ -208,7 +208,7 @@ class LoopTest extends RulesEntityIntegrationTestBase { /** * Tests that a loop must have a list configured. */ - public function testMissingList() { + public function testMissingList(): void { $rule = $this->rulesExpressionManager->createRule(); // Empty loop configuration, 'list' is missing. @@ -228,7 +228,7 @@ class LoopTest extends RulesEntityIntegrationTestBase { /** * Tests that a variable used in an action within the loop exists. */ - public function testWrongVariableInAction() { + public function testWrongVariableInAction(): void { $rule = $this->rulesExpressionManager->createRule(); $loop = $this->rulesExpressionManager->createInstance('rules_loop', ['list' => 'string_list']); @@ -253,7 +253,7 @@ class LoopTest extends RulesEntityIntegrationTestBase { /** * Tests that the data type used to loop over is a list. */ - public function testInvalidListType() { + public function testInvalidListType(): void { $rule = $this->rulesExpressionManager->createRule(); $loop = $this->rulesExpressionManager->createInstance('rules_loop', [ @@ -276,7 +276,7 @@ class LoopTest extends RulesEntityIntegrationTestBase { /** * Tests that the loop list item variable is not available after the loop. */ - public function testOutOfScopeVariable() { + public function testOutOfScopeVariable(): void { $rule = $this->rulesExpressionManager->createRule(); $loop = $this->rulesExpressionManager->createInstance('rules_loop', ['list' => 'string_list']); @@ -300,7 +300,7 @@ class LoopTest extends RulesEntityIntegrationTestBase { /** * Tests that the loop list item variable is not available after the loop. */ - public function testOutOfScopeVariableExecution() { + public function testOutOfScopeVariableExecution(): void { // Set the expected exception class and message. $this->expectException(EvaluationException::class); $this->expectExceptionMessage("Unable to get variable 'list_item'; it is not defined."); diff --git a/tests/src/Unit/Integration/Engine/PrepareExecutionMetadataStateTest.php b/tests/src/Unit/Integration/Engine/PrepareExecutionMetadataStateTest.php index 58e88c009af7272bcb379eebe1895bb432ef52b5..8b7c822f329cb8986fb23b61355cd85664495534 100644 --- a/tests/src/Unit/Integration/Engine/PrepareExecutionMetadataStateTest.php +++ b/tests/src/Unit/Integration/Engine/PrepareExecutionMetadataStateTest.php @@ -18,7 +18,7 @@ class PrepareExecutionMetadataStateTest extends RulesEntityIntegrationTestBase { /** * Tests that a variable can be added by an action and is then available. */ - public function testAddingVariable() { + public function testAddingVariable(): void { $rule = $this->rulesExpressionManager->createRule(); $rule->addAction('rules_variable_add', ContextConfig::create() ->setValue('type', 'string') @@ -35,7 +35,7 @@ class PrepareExecutionMetadataStateTest extends RulesEntityIntegrationTestBase { /** * Tests partial state setup until an expression is reached in the tree. */ - public function testPreparingUntil() { + public function testPreparingUntil(): void { // Setup a rule with 2 actions. $rule = $this->rulesExpressionManager->createRule(); $rule->addAction('rules_variable_add', ContextConfig::create() @@ -64,7 +64,7 @@ class PrepareExecutionMetadataStateTest extends RulesEntityIntegrationTestBase { /** * Tests that state preparation also works for actions in a loop. */ - public function testPrepareInLoop() { + public function testPrepareInLoop(): void { $rule = $this->rulesExpressionManager->createRule(); $loop = $this->rulesExpressionManager->createInstance('rules_loop', ['list' => 'string_list']); @@ -89,7 +89,7 @@ class PrepareExecutionMetadataStateTest extends RulesEntityIntegrationTestBase { /** * Tests that the loop list item is removed after the loop. */ - public function testPrepareAfterLoop() { + public function testPrepareAfterLoop(): void { $rule = $this->rulesExpressionManager->createRule(); $loop = $this->rulesExpressionManager->createInstance('rules_loop', ['list' => 'string_list']); diff --git a/tests/src/Unit/Integration/Engine/RulesComponentTest.php b/tests/src/Unit/Integration/Engine/RulesComponentTest.php index 1ab21352598646eae1e48e0af4f472e6cf5b81ce..a45b1a91aaf18c923e150b83c401bfc541d016c0 100644 --- a/tests/src/Unit/Integration/Engine/RulesComponentTest.php +++ b/tests/src/Unit/Integration/Engine/RulesComponentTest.php @@ -19,7 +19,7 @@ class RulesComponentTest extends RulesIntegrationTestBase { /** * Tests executing a rule providing context based upon given context. */ - public function testRuleExecutionWithContext() { + public function testRuleExecutionWithContext(): void { $rule = $this->rulesExpressionManager->createRule(); $rule->addAction('rules_test_string', @@ -41,7 +41,7 @@ class RulesComponentTest extends RulesIntegrationTestBase { /** * @covers ::getExpression */ - public function testGetExpression() { + public function testGetExpression(): void { $rule = $this->rulesExpressionManager->createRule(); $this->assertSame(RulesComponent::create($rule)->getExpression(), $rule); } @@ -49,7 +49,7 @@ class RulesComponentTest extends RulesIntegrationTestBase { /** * @covers ::getContextDefinitions */ - public function testGetContextDefinitions() { + public function testGetContextDefinitions(): void { $rule = $this->rulesExpressionManager->createRule(); $definition = ContextDefinition::create('string'); $component = RulesComponent::create($rule) @@ -62,7 +62,7 @@ class RulesComponentTest extends RulesIntegrationTestBase { /** * @covers ::getProvidedContext */ - public function testGetProvidedContext() { + public function testGetProvidedContext(): void { $rule = $this->rulesExpressionManager->createRule(); $component = RulesComponent::create($rule) ->provideContext('test'); @@ -73,7 +73,7 @@ class RulesComponentTest extends RulesIntegrationTestBase { /** * @covers ::getState */ - public function testGetState() { + public function testGetState(): void { $rule = $this->rulesExpressionManager->createRule(); $component = RulesComponent::create($rule); $this->assertInstanceOf(ExecutionStateInterface::class, $component->getState()); diff --git a/tests/src/Unit/Integration/Event/EntityDeleteTest.php b/tests/src/Unit/Integration/Event/EntityDeleteTest.php index 27be10b66f8e1febee54300acafc77ea6774edf4..d2abf6f8020ad5de3426bca4239b3b965bab37e4 100644 --- a/tests/src/Unit/Integration/Event/EntityDeleteTest.php +++ b/tests/src/Unit/Integration/Event/EntityDeleteTest.php @@ -14,7 +14,7 @@ class EntityDeleteTest extends EventTestBase { /** * Tests the event metadata. */ - public function testEventMetadata() { + public function testEventMetadata(): void { $plugin_definition = $this->eventManager->getDefinition('rules_entity_delete:test'); $this->assertSame('After deleting a test entity', (string) $plugin_definition['label']); $context_definition = $plugin_definition['context_definitions']['test']; diff --git a/tests/src/Unit/Integration/Event/EntityInsertTest.php b/tests/src/Unit/Integration/Event/EntityInsertTest.php index 93881567b6b76ed8075584e60fcf678955682cf1..781603f5cea45342cc51c088e0898f6081b50f23 100644 --- a/tests/src/Unit/Integration/Event/EntityInsertTest.php +++ b/tests/src/Unit/Integration/Event/EntityInsertTest.php @@ -14,7 +14,7 @@ class EntityInsertTest extends EventTestBase { /** * Tests the event metadata. */ - public function testEventMetadata() { + public function testEventMetadata(): void { $plugin_definition = $this->eventManager->getDefinition('rules_entity_insert:test'); $this->assertSame('After saving a new test entity', (string) $plugin_definition['label']); $context_definition = $plugin_definition['context_definitions']['test']; diff --git a/tests/src/Unit/Integration/Event/EntityPresaveTest.php b/tests/src/Unit/Integration/Event/EntityPresaveTest.php index 00a63a970e9af6c046f87e0672a1993abf0f25dc..f700443e00a6bc03cdc130d749a75238496b395c 100644 --- a/tests/src/Unit/Integration/Event/EntityPresaveTest.php +++ b/tests/src/Unit/Integration/Event/EntityPresaveTest.php @@ -14,7 +14,7 @@ class EntityPresaveTest extends EventTestBase { /** * Tests the event metadata. */ - public function testEventMetadata() { + public function testEventMetadata(): void { $plugin_definition = $this->eventManager->getDefinition('rules_entity_presave:test'); $this->assertSame('Before saving a test entity', (string) $plugin_definition['label']); $context_definition = $plugin_definition['context_definitions']['test']; diff --git a/tests/src/Unit/Integration/Event/EntityUpdateTest.php b/tests/src/Unit/Integration/Event/EntityUpdateTest.php index d7876cf83c718516864e72f0e20134c15796e642..1ed89401e7904f53ff44dcf8fc44385f465d5b11 100644 --- a/tests/src/Unit/Integration/Event/EntityUpdateTest.php +++ b/tests/src/Unit/Integration/Event/EntityUpdateTest.php @@ -14,7 +14,7 @@ class EntityUpdateTest extends EventTestBase { /** * Tests the event metadata. */ - public function testEventMetadata() { + public function testEventMetadata(): void { $plugin_definition = $this->eventManager->getDefinition('rules_entity_update:test'); $this->assertSame('After updating a test entity', (string) $plugin_definition['label']); $context_definition = $plugin_definition['context_definitions']['test']; diff --git a/tests/src/Unit/Integration/Event/EntityViewTest.php b/tests/src/Unit/Integration/Event/EntityViewTest.php index bdbd3ec925cdfb0e9787bcaf22f4fe2e0f940915..8fb74a6292014ea25ee3ab8382fac7a060c17b31 100644 --- a/tests/src/Unit/Integration/Event/EntityViewTest.php +++ b/tests/src/Unit/Integration/Event/EntityViewTest.php @@ -14,7 +14,7 @@ class EntityViewTest extends EventTestBase { /** * Tests the event metadata. */ - public function testEventMetadata() { + public function testEventMetadata(): void { $plugin_definition = $this->eventManager->getDefinition('rules_entity_view:test'); $this->assertSame('Entity of type test is viewed', (string) $plugin_definition['label']); $context_definition = $plugin_definition['context_definitions']['test']; diff --git a/tests/src/Unit/Integration/Event/SystemLoggerEventTest.php b/tests/src/Unit/Integration/Event/SystemLoggerEventTest.php index 14bd60f738d4e638a8a7985251ec2a90e27d41ba..a58fbf150311ce89c926d3b73ff2477f0a49a201 100644 --- a/tests/src/Unit/Integration/Event/SystemLoggerEventTest.php +++ b/tests/src/Unit/Integration/Event/SystemLoggerEventTest.php @@ -12,7 +12,7 @@ class SystemLoggerEventTest extends EventTestBase { /** * Tests the event metadata. */ - public function testSystemLoggerEvent() { + public function testSystemLoggerEvent(): void { $event = $this->eventManager->createInstance('rules_system_logger_event'); $logger_entry = $event->getContextDefinition('logger_entry'); diff --git a/tests/src/Unit/Integration/Event/UserLoginTest.php b/tests/src/Unit/Integration/Event/UserLoginTest.php index 9322800b8fd9a55bd711387e107822c41838ef2a..869ef81e17e44a81491253a155541fe207d2dae2 100644 --- a/tests/src/Unit/Integration/Event/UserLoginTest.php +++ b/tests/src/Unit/Integration/Event/UserLoginTest.php @@ -12,7 +12,7 @@ class UserLoginTest extends EventTestBase { /** * Tests the event metadata. */ - public function testUserLoginEvent() { + public function testUserLoginEvent(): void { $event = $this->eventManager->createInstance('rules_user_login'); $user_context_definition = $event->getContextDefinition('account'); $this->assertSame('entity:user', $user_context_definition->getDataType()); diff --git a/tests/src/Unit/Integration/Event/UserLogoutTest.php b/tests/src/Unit/Integration/Event/UserLogoutTest.php index 8fece37d5fe944a3e78f43f650b6db704be785f6..a6a331640a36c6963bc546dcae7bcf6c9a6cb012 100644 --- a/tests/src/Unit/Integration/Event/UserLogoutTest.php +++ b/tests/src/Unit/Integration/Event/UserLogoutTest.php @@ -12,7 +12,7 @@ class UserLogoutTest extends EventTestBase { /** * Tests the event metadata. */ - public function testUserLogoutEvent() { + public function testUserLogoutEvent(): void { $event = $this->eventManager->createInstance('rules_user_logout'); $user_context_definition = $event->getContextDefinition('account'); $this->assertSame('entity:user', $user_context_definition->getDataType()); diff --git a/tests/src/Unit/Integration/RulesAction/BanIpTest.php b/tests/src/Unit/Integration/RulesAction/BanIpTest.php index 0d7a1a629a9bf8d3835ec72a29cc789d6f5366bc..40db7b925d6f09c3c2429d729b755990fcd1d929 100644 --- a/tests/src/Unit/Integration/RulesAction/BanIpTest.php +++ b/tests/src/Unit/Integration/RulesAction/BanIpTest.php @@ -77,7 +77,7 @@ class BanIpTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Ban an IP address', $this->action->summary()); } @@ -91,7 +91,7 @@ class BanIpTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithContextIpv4() { + public function testActionExecutionWithContextIpv4(): void { // TEST-NET-1 IPv4. $ipv4 = '192.0.2.0'; $this->action->setContextValue('ip', $ipv4); @@ -113,7 +113,7 @@ class BanIpTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithContextIpv6() { + public function testActionExecutionWithContextIpv6(): void { // TEST-NET-1 IPv4 '192.0.2.0' converted to IPv6. $ipv6 = '2002:0:0:0:0:0:c000:200'; $this->action->setContextValue('ip', $ipv6); @@ -132,7 +132,7 @@ class BanIpTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithoutContextIp() { + public function testActionExecutionWithoutContextIp(): void { // TEST-NET-1 IPv4. $ip = '192.0.2.0'; diff --git a/tests/src/Unit/Integration/RulesAction/DataCalculateValueTest.php b/tests/src/Unit/Integration/RulesAction/DataCalculateValueTest.php index 315459940c888fa0c832c8a8fd7deea63e896943..cfa2148de5ac5a4cbc2abdf50ad1f6e97ae52a00 100644 --- a/tests/src/Unit/Integration/RulesAction/DataCalculateValueTest.php +++ b/tests/src/Unit/Integration/RulesAction/DataCalculateValueTest.php @@ -30,7 +30,7 @@ class DataCalculateValueTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Calculate a numeric value', $this->action->summary()); } @@ -39,7 +39,7 @@ class DataCalculateValueTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testAdditionAction() { + public function testAdditionAction(): void { $input_1 = mt_rand(); $input_2 = mt_rand(); $this->action->setContextValue('input_1', $this->getTypedData('float', $input_1)) @@ -55,7 +55,7 @@ class DataCalculateValueTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testSubtractionAction() { + public function testSubtractionAction(): void { $input_1 = mt_rand(); $input_2 = mt_rand(); $this->action->setContextValue('input_1', $this->getTypedData('float', $input_1)) @@ -71,7 +71,7 @@ class DataCalculateValueTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testMultiplicationAction() { + public function testMultiplicationAction(): void { $input_1 = mt_rand(); $input_2 = mt_rand(); $this->action->setContextValue('input_1', $this->getTypedData('float', $input_1)) @@ -87,7 +87,7 @@ class DataCalculateValueTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testDivisionAction() { + public function testDivisionAction(): void { $input_1 = mt_rand(); $input_2 = mt_rand(); $this->action->setContextValue('input_1', $this->getTypedData('float', $input_1)) @@ -103,7 +103,7 @@ class DataCalculateValueTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testMinimumAction() { + public function testMinimumAction(): void { $input_1 = mt_rand(); $input_2 = mt_rand(); $this->action->setContextValue('input_1', $this->getTypedData('float', $input_1)) @@ -119,7 +119,7 @@ class DataCalculateValueTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testMaximumAction() { + public function testMaximumAction(): void { $input_1 = mt_rand(); $input_2 = mt_rand(); $this->action->setContextValue('input_1', $this->getTypedData('float', $input_1)) diff --git a/tests/src/Unit/Integration/RulesAction/DataConvertTest.php b/tests/src/Unit/Integration/RulesAction/DataConvertTest.php index ad1d145f6a2578b0e5049386e72074a0cea48663..88697f232d6e94fb1e089904d1026a4267e78751 100644 --- a/tests/src/Unit/Integration/RulesAction/DataConvertTest.php +++ b/tests/src/Unit/Integration/RulesAction/DataConvertTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\rules\Unit\Integration\RulesAction; +use Drupal\Core\TypedData\TypedDataInterface; use Drupal\Tests\rules\Unit\Integration\RulesIntegrationTestBase; use Drupal\rules\Exception\InvalidArgumentException; @@ -32,7 +33,7 @@ class DataConvertTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testConvertToInteger() { + public function testConvertToInteger(): void { $value = 1.5; // Test the conversion to integer. @@ -69,7 +70,7 @@ class DataConvertTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testConvertToFloat() { + public function testConvertToFloat(): void { $value = '1.5'; $converted = $this->executeAction($value, 'float'); @@ -88,7 +89,7 @@ class DataConvertTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testConvertToString() { + public function testConvertToString(): void { // Test the conversion to test/string. $value = 1.5; @@ -103,7 +104,7 @@ class DataConvertTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testInvalidValueException() { + public function testInvalidValueException(): void { // Set the expected exception class and message. $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Only scalar values are supported.'); @@ -116,7 +117,7 @@ class DataConvertTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testInvalidRoundingBehavior() { + public function testInvalidRoundingBehavior(): void { // Set the expected exception class and message. $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('A rounding behavior only makes sense with an integer target type.'); @@ -131,7 +132,7 @@ class DataConvertTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testInvalidRoundingBehaviorException() { + public function testInvalidRoundingBehaviorException(): void { // Set the expected exception class and message. $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Unknown rounding behavior: invalid rounding'); @@ -146,7 +147,7 @@ class DataConvertTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testInvalidTargetTypeException() { + public function testInvalidTargetTypeException(): void { // Set the expected exception class and message. $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Unknown target type: invalid type'); @@ -160,7 +161,7 @@ class DataConvertTest extends RulesIntegrationTestBase { * * @covers ::refineContextDefinitions */ - public function testRefiningContextDefinitions() { + public function testRefiningContextDefinitions(): void { // Before context refinement, conversion_result data type defaults to 'any'. $this->assertEquals( 'any', @@ -188,7 +189,7 @@ class DataConvertTest extends RulesIntegrationTestBase { * @return \Drupal\Core\TypedData\TypedDataInterface * The raw conversion result as a typed data object. */ - protected function executeAction($value, $target_type, $rounding_behavior = NULL) { + protected function executeAction($value, $target_type, $rounding_behavior = NULL): TypedDataInterface { $this->action->setContextValue('value', $value); $this->action->setContextValue('target_type', $target_type); diff --git a/tests/src/Unit/Integration/RulesAction/DataListItemAddTest.php b/tests/src/Unit/Integration/RulesAction/DataListItemAddTest.php index 06bf305c47c217e0d5987945be8e81dc79d4abe3..70b294a0823cda1105c9a3792b24c8beb45f8a25 100644 --- a/tests/src/Unit/Integration/RulesAction/DataListItemAddTest.php +++ b/tests/src/Unit/Integration/RulesAction/DataListItemAddTest.php @@ -31,7 +31,7 @@ class DataListItemAddTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Add list item', $this->action->summary()); } @@ -40,7 +40,7 @@ class DataListItemAddTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithDefaults() { + public function testActionExecutionWithDefaults(): void { // Test adding a value at the end (default position). $list = ['One', 'Two', 'Three']; @@ -64,7 +64,7 @@ class DataListItemAddTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionItemAppend() { + public function testActionExecutionItemAppend(): void { // Test adding a value at the end. $list = ['One', 'Two', 'Three']; @@ -89,7 +89,7 @@ class DataListItemAddTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionItemPrepend() { + public function testActionExecutionItemPrepend(): void { // Test adding a value at the start. $list = ['One', 'Two', 'Three']; @@ -114,7 +114,7 @@ class DataListItemAddTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionEnforceUnique() { + public function testActionExecutionEnforceUnique(): void { // Test unique. $list = ['One', 'Two', 'Three', 'Four']; @@ -139,7 +139,7 @@ class DataListItemAddTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionNonUnique() { + public function testActionExecutionNonUnique(): void { // Test non-unique. $list = ['One', 'Two', 'Three', 'Four']; diff --git a/tests/src/Unit/Integration/RulesAction/DataListItemRemoveTest.php b/tests/src/Unit/Integration/RulesAction/DataListItemRemoveTest.php index c7adcc4df926ec796b1e120209ad9f6a5dca5f46..f5eeff5ab8e4280609ff09098af8794ffe2e173f 100644 --- a/tests/src/Unit/Integration/RulesAction/DataListItemRemoveTest.php +++ b/tests/src/Unit/Integration/RulesAction/DataListItemRemoveTest.php @@ -31,7 +31,7 @@ class DataListItemRemoveTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Remove item from list', $this->action->summary()); } @@ -40,7 +40,7 @@ class DataListItemRemoveTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $list = ['One', 'Two', 'Three']; $this->action diff --git a/tests/src/Unit/Integration/RulesAction/DataSetTest.php b/tests/src/Unit/Integration/RulesAction/DataSetTest.php index 2d28c86bb7576efb0efdd15d85db9e2a8da4daa8..084951d7303c4c5e1144527712f6740c9349ec34 100644 --- a/tests/src/Unit/Integration/RulesAction/DataSetTest.php +++ b/tests/src/Unit/Integration/RulesAction/DataSetTest.php @@ -30,7 +30,7 @@ class DataSetTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Set a data value', $this->action->summary()); } @@ -39,7 +39,7 @@ class DataSetTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testPrimitiveValues() { + public function testPrimitiveValues(): void { $this->action->setContextValue('data', 'original') ->setContextValue('value', 'replacement'); $this->action->execute(); @@ -51,7 +51,7 @@ class DataSetTest extends RulesIntegrationTestBase { /** * Tests that a variable can be set to NULL. */ - public function testSetToNull() { + public function testSetToNull(): void { // We don't need to set the 'value' context, it is NULL by default. $this->action->setContextValue('data', 'original'); $this->action->execute(); diff --git a/tests/src/Unit/Integration/RulesAction/EntityCreateTest.php b/tests/src/Unit/Integration/RulesAction/EntityCreateTest.php index ca758b7027f8e8c647934fa0bcf62c2f3d5e464f..378109ec3b3cef7abd230b48b53fe46874631427 100644 --- a/tests/src/Unit/Integration/RulesAction/EntityCreateTest.php +++ b/tests/src/Unit/Integration/RulesAction/EntityCreateTest.php @@ -107,7 +107,7 @@ class EntityCreateTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Create a new test entity', $this->action->summary()); } @@ -116,7 +116,7 @@ class EntityCreateTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $this->action->setContextValue('bundle', 'test'); $this->action->execute(); $entity = $this->action->getProvidedContext('test_created')->getContextValue(); @@ -128,7 +128,7 @@ class EntityCreateTest extends RulesEntityIntegrationTestBase { * * @covers \Drupal\rules\Plugin\RulesAction\EntityCreateDeriver::getDerivativeDefinitions */ - public function testRequiredContexts() { + public function testRequiredContexts(): void { $context_definitions = $this->action->getContextDefinitions(); $this->assertCount(2, $context_definitions); @@ -146,7 +146,7 @@ class EntityCreateTest extends RulesEntityIntegrationTestBase { * * @covers ::refineContextDefinitions */ - public function testRefiningContextDefinitions() { + public function testRefiningContextDefinitions(): void { $this->action->setContextValue('bundle', 'bundle_test'); $this->action->refineContextDefinitions([]); $this->assertEquals( diff --git a/tests/src/Unit/Integration/RulesAction/EntityDeleteTest.php b/tests/src/Unit/Integration/RulesAction/EntityDeleteTest.php index c51591f43bace9612e778b687efbc678d645e3b3..3270aa68ced4914c7c2920beb911f9eea158b8f5 100644 --- a/tests/src/Unit/Integration/RulesAction/EntityDeleteTest.php +++ b/tests/src/Unit/Integration/RulesAction/EntityDeleteTest.php @@ -32,7 +32,7 @@ class EntityDeleteTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Delete entity', $this->action->summary()); } @@ -41,7 +41,7 @@ class EntityDeleteTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $entity = $this->prophesizeEntity(EntityInterface::class); $entity->delete()->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/RulesAction/EntityFetchByFieldTest.php b/tests/src/Unit/Integration/RulesAction/EntityFetchByFieldTest.php index 7a40b6837424e24f156439d81f68bee39716326e..9c459d2309eabf0dc257178887f7cf4dd9850203 100644 --- a/tests/src/Unit/Integration/RulesAction/EntityFetchByFieldTest.php +++ b/tests/src/Unit/Integration/RulesAction/EntityFetchByFieldTest.php @@ -34,7 +34,7 @@ class EntityFetchByFieldTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Fetch entities by field', $this->action->summary()); } @@ -43,7 +43,7 @@ class EntityFetchByFieldTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithNoLimit() { + public function testActionExecutionWithNoLimit(): void { // Create variables for action context values. $entity_type = 'entity_test'; $field_name = 'test_field'; @@ -79,7 +79,7 @@ class EntityFetchByFieldTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithLimit() { + public function testActionExecutionWithLimit(): void { $entity_type = 'entity_test'; $field_name = 'test_field'; $field_value = 'llama'; @@ -137,7 +137,7 @@ class EntityFetchByFieldTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionProvidedContextEntityType() { + public function testActionExecutionProvidedContextEntityType(): void { // Create variables for action context values. $entity_type = 'entity_test'; $field_name = 'test_field'; @@ -168,7 +168,7 @@ class EntityFetchByFieldTest extends RulesEntityIntegrationTestBase { /** * @covers ::refineContextDefinitions */ - public function testRefiningContextDefinitions() { + public function testRefiningContextDefinitions(): void { $this->action->setContextValue('type', 'entity_test'); $this->action->refineContextDefinitions([]); $this->assertEquals( diff --git a/tests/src/Unit/Integration/RulesAction/EntityFetchByIdTest.php b/tests/src/Unit/Integration/RulesAction/EntityFetchByIdTest.php index cfa42ce7ae7188ccb56ee4764a2ba674f6595880..401f299bdf0f808ffeb41bfa7edd9f948169041d 100644 --- a/tests/src/Unit/Integration/RulesAction/EntityFetchByIdTest.php +++ b/tests/src/Unit/Integration/RulesAction/EntityFetchByIdTest.php @@ -33,7 +33,7 @@ class EntityFetchByIdTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Fetch entity by id', $this->action->summary()); } @@ -42,7 +42,7 @@ class EntityFetchByIdTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $entity_type = 'entity_test'; // Prepare entity storage to return dummy entity on the 'load' execution. @@ -67,7 +67,7 @@ class EntityFetchByIdTest extends RulesEntityIntegrationTestBase { /** * @covers ::refineContextDefinitions */ - public function testRefiningContextDefinitions() { + public function testRefiningContextDefinitions(): void { $this->action->setContextValue('type', 'entity_test'); $this->action->refineContextDefinitions([]); $this->assertEquals( diff --git a/tests/src/Unit/Integration/RulesAction/EntityPathAliasCreateTest.php b/tests/src/Unit/Integration/RulesAction/EntityPathAliasCreateTest.php index 790eb66579182c6cb206acc5b292c512745c7ea7..d57a3a32957e1a42a16696e4a98916737d4d4f4c 100644 --- a/tests/src/Unit/Integration/RulesAction/EntityPathAliasCreateTest.php +++ b/tests/src/Unit/Integration/RulesAction/EntityPathAliasCreateTest.php @@ -50,7 +50,7 @@ class EntityPathAliasCreateTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Create a test path alias', $this->action->summary()); } @@ -59,7 +59,7 @@ class EntityPathAliasCreateTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithUnsavedEntity() { + public function testActionExecutionWithUnsavedEntity(): void { $path_alias = $this->prophesizeEntity(PathAliasInterface::class); // Test that the alias is only saved once. @@ -89,7 +89,7 @@ class EntityPathAliasCreateTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithSavedEntity() { + public function testActionExecutionWithSavedEntity(): void { $path_alias = $this->prophesizeEntity(PathAliasInterface::class); // Test that the alias is only saved once. diff --git a/tests/src/Unit/Integration/RulesAction/EntitySaveTest.php b/tests/src/Unit/Integration/RulesAction/EntitySaveTest.php index fa5042d4bcf5b7c78e68f7711838c12accfad7ae..90c5bad764bf84236cb2fd5a517b1d31b2167056 100644 --- a/tests/src/Unit/Integration/RulesAction/EntitySaveTest.php +++ b/tests/src/Unit/Integration/RulesAction/EntitySaveTest.php @@ -41,7 +41,7 @@ class EntitySaveTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Save entity', $this->action->summary()); } @@ -50,7 +50,7 @@ class EntitySaveTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionImmediately() { + public function testActionExecutionImmediately(): void { $this->entity->save()->shouldBeCalledTimes(1); $this->action->setContextValue('entity', $this->entity->reveal()) @@ -65,7 +65,7 @@ class EntitySaveTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionPostponed() { + public function testActionExecutionPostponed(): void { $this->entity->save()->shouldNotBeCalled(); $this->action->setContextValue('entity', $this->entity->reveal()); diff --git a/tests/src/Unit/Integration/RulesAction/NodeMakeStickyTest.php b/tests/src/Unit/Integration/RulesAction/NodeMakeStickyTest.php index 69f27de9a47508a9ef1fc65a72bda5c6b3c433b2..de8d3b9f9997d2d0a242e87ee216d949e1116496 100644 --- a/tests/src/Unit/Integration/RulesAction/NodeMakeStickyTest.php +++ b/tests/src/Unit/Integration/RulesAction/NodeMakeStickyTest.php @@ -32,7 +32,7 @@ class NodeMakeStickyTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Make selected content sticky', $this->action->summary()); } @@ -41,7 +41,7 @@ class NodeMakeStickyTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $node = $this->prophesizeEntity(NodeInterface::class); $node->setSticky(NodeInterface::STICKY)->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/RulesAction/NodeMakeUnstickyTest.php b/tests/src/Unit/Integration/RulesAction/NodeMakeUnstickyTest.php index 831d2f66ec46b5da626ac192d1e00aa815b530ed..030016c4bc70c45c76c703f6cc3e970a75ed60bc 100644 --- a/tests/src/Unit/Integration/RulesAction/NodeMakeUnstickyTest.php +++ b/tests/src/Unit/Integration/RulesAction/NodeMakeUnstickyTest.php @@ -32,7 +32,7 @@ class NodeMakeUnstickyTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Make selected content not sticky', $this->action->summary()); } @@ -41,7 +41,7 @@ class NodeMakeUnstickyTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $node = $this->prophesizeEntity(NodeInterface::class); $node->setSticky(NodeInterface::NOT_STICKY)->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/RulesAction/NodePromoteTest.php b/tests/src/Unit/Integration/RulesAction/NodePromoteTest.php index 965a18bb7dcdf3582203a9fd18cf4220b495767c..5453b97fcb0328726cb306ff19fffa9e77c13bdb 100644 --- a/tests/src/Unit/Integration/RulesAction/NodePromoteTest.php +++ b/tests/src/Unit/Integration/RulesAction/NodePromoteTest.php @@ -32,7 +32,7 @@ class NodePromoteTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Promote selected content to front page', $this->action->summary()); } @@ -41,7 +41,7 @@ class NodePromoteTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $node = $this->prophesizeEntity(NodeInterface::class); $node->setPromoted(NodeInterface::PROMOTED)->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/RulesAction/NodePublishTest.php b/tests/src/Unit/Integration/RulesAction/NodePublishTest.php index 51eb122312e9d68bdef65e8a416afd5ce511186a..6dc466312139aa1df04b74b6f8b73f26ca117165 100644 --- a/tests/src/Unit/Integration/RulesAction/NodePublishTest.php +++ b/tests/src/Unit/Integration/RulesAction/NodePublishTest.php @@ -32,7 +32,7 @@ class NodePublishTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Publish a content item', $this->action->summary()); } @@ -41,7 +41,7 @@ class NodePublishTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $node = $this->prophesizeEntity(NodeInterface::class); $node->setPublished()->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/RulesAction/NodeUnpromoteTest.php b/tests/src/Unit/Integration/RulesAction/NodeUnpromoteTest.php index df825eb2d0f85d3d65c8742124c3c8eb8df1ceed..ceb66e5426f3a2552480302f1ff554ec83879e66 100644 --- a/tests/src/Unit/Integration/RulesAction/NodeUnpromoteTest.php +++ b/tests/src/Unit/Integration/RulesAction/NodeUnpromoteTest.php @@ -32,7 +32,7 @@ class NodeUnpromoteTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Demote selected content from front page', $this->action->summary()); } @@ -41,7 +41,7 @@ class NodeUnpromoteTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $node = $this->prophesizeEntity(NodeInterface::class); $node->setPromoted(NodeInterface::NOT_PROMOTED)->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/RulesAction/NodeUnpublishTest.php b/tests/src/Unit/Integration/RulesAction/NodeUnpublishTest.php index 7d05530da468b5289f2e756d3497046e0075af7e..ccfd76feb02048fabbbd5a21cb39fa0e6cfde5ad 100644 --- a/tests/src/Unit/Integration/RulesAction/NodeUnpublishTest.php +++ b/tests/src/Unit/Integration/RulesAction/NodeUnpublishTest.php @@ -32,7 +32,7 @@ class NodeUnpublishTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Unpublish a content item', $this->action->summary()); } @@ -41,7 +41,7 @@ class NodeUnpublishTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $node = $this->prophesizeEntity(NodeInterface::class); $node->setUnpublished()->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/RulesAction/PathAliasCreateTest.php b/tests/src/Unit/Integration/RulesAction/PathAliasCreateTest.php index 36387cb191574660b63669ab1b4479b4e0673126..440eff9f10eb704e125c16246d2cd521f4c222de 100644 --- a/tests/src/Unit/Integration/RulesAction/PathAliasCreateTest.php +++ b/tests/src/Unit/Integration/RulesAction/PathAliasCreateTest.php @@ -47,7 +47,7 @@ class PathAliasCreateTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Create any path alias', $this->action->summary()); } @@ -56,7 +56,7 @@ class PathAliasCreateTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithoutLanguage() { + public function testActionExecutionWithoutLanguage(): void { $path_alias = $this->prophesizeEntity(PathAliasInterface::class); $path_alias->save()->shouldBeCalledTimes(1); @@ -78,7 +78,7 @@ class PathAliasCreateTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithLanguage() { + public function testActionExecutionWithLanguage(): void { $path_alias = $this->prophesizeEntity(PathAliasInterface::class); $path_alias->save()->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/Integration/RulesAction/PathAliasDeleteByAliasTest.php b/tests/src/Unit/Integration/RulesAction/PathAliasDeleteByAliasTest.php index 7ab0032abe7528838d8aa9065428716cc8e51a0b..c84dfa57a4258c267dc5b82643b0f5977c2c8a09 100644 --- a/tests/src/Unit/Integration/RulesAction/PathAliasDeleteByAliasTest.php +++ b/tests/src/Unit/Integration/RulesAction/PathAliasDeleteByAliasTest.php @@ -46,7 +46,7 @@ class PathAliasDeleteByAliasTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Delete path alias', $this->action->summary()); } @@ -55,7 +55,7 @@ class PathAliasDeleteByAliasTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $alias = '/about/team'; $this->action->setContextValue('alias', $alias); diff --git a/tests/src/Unit/Integration/RulesAction/PathAliasDeleteByPathTest.php b/tests/src/Unit/Integration/RulesAction/PathAliasDeleteByPathTest.php index 0c1c317721736be021bb40d489b047a8acac8e38..350d8fe899b3f040825ec7f7ad5e2980582c141c 100644 --- a/tests/src/Unit/Integration/RulesAction/PathAliasDeleteByPathTest.php +++ b/tests/src/Unit/Integration/RulesAction/PathAliasDeleteByPathTest.php @@ -46,7 +46,7 @@ class PathAliasDeleteByPathTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Delete all aliases for a path', $this->action->summary()); } @@ -55,7 +55,7 @@ class PathAliasDeleteByPathTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $path = '/node/1'; $this->action->setContextValue('path', $path); diff --git a/tests/src/Unit/Integration/RulesAction/RulesActionAccessTest.php b/tests/src/Unit/Integration/RulesAction/RulesActionAccessTest.php index e54de91cdf8bae4d315a59f0d8eb4558e1cbdb78..8898aea487a443948a9b8e39d46f697595704135 100644 --- a/tests/src/Unit/Integration/RulesAction/RulesActionAccessTest.php +++ b/tests/src/Unit/Integration/RulesAction/RulesActionAccessTest.php @@ -16,7 +16,7 @@ class RulesActionAccessTest extends RulesIntegrationTestBase { /** * Confirm that a condition plugin respects configure permission. */ - public function testHasConfigurationAccessInfo() { + public function testHasConfigurationAccessInfo(): void { $plugin = $this->actionManager->createInstance('rules_test_string'); $definition = $plugin->getPluginDefinition(); $this->assertNotEmpty($definition['configure_permissions'], "Plugin has configuration permission info."); @@ -53,7 +53,6 @@ class RulesActionAccessTest extends RulesIntegrationTestBase { "User without permission does not have configuration access."); $object_result = $plugin->checkConfigurationAccess($user_without_perm->reveal(), TRUE); $this->assertTrue($object_result->isNeutral(), "an AccessResultNeutral object is returned on not allowed if an object is requested."); - } } diff --git a/tests/src/Unit/Integration/RulesAction/RulesActionManagerTest.php b/tests/src/Unit/Integration/RulesAction/RulesActionManagerTest.php index 77aba2104ee0704a0de97dc51df46fc70b1ff763..4dfd0d3195951da5f9732ae393346d1200e9be6e 100644 --- a/tests/src/Unit/Integration/RulesAction/RulesActionManagerTest.php +++ b/tests/src/Unit/Integration/RulesAction/RulesActionManagerTest.php @@ -16,7 +16,7 @@ class RulesActionManagerTest extends RulesIntegrationTestBase { /** * @covers ::getDiscovery */ - public function testContextDefinitionAnnotations() { + public function testContextDefinitionAnnotations(): void { $definitions = $this->actionManager->getDefinitions(); // Make sure all context definitions are using the class provided by Rules. foreach ($definitions as $definition) { diff --git a/tests/src/Unit/Integration/RulesAction/RulesAdminAccessTest.php b/tests/src/Unit/Integration/RulesAction/RulesAdminAccessTest.php index cc83512da6cdbbb40c5471f4e32d4c9a40a31cc5..65d7dadaf680e637125b47c202b8c3a0bdbaf568 100644 --- a/tests/src/Unit/Integration/RulesAction/RulesAdminAccessTest.php +++ b/tests/src/Unit/Integration/RulesAction/RulesAdminAccessTest.php @@ -17,7 +17,7 @@ class RulesAdminAccessTest extends RulesIntegrationTestBase { /** * Test administrative access to plugin configuration UI. */ - public function testRespectsAdminPermissions() { + public function testRespectsAdminPermissions(): void { // 3 user classes to test. $super_admin = $this->prophesize(AccountInterface::class); $super_admin->hasPermission(Argument::any())->willReturn(TRUE); @@ -55,7 +55,6 @@ class RulesAdminAccessTest extends RulesIntegrationTestBase { $user = $joe_user->reveal(); $this->assertFalse($action->checkConfigurationAccess($user), "Ordinary user lacks admin access"); - } } diff --git a/tests/src/Unit/Integration/RulesAction/RulesComponentActionTest.php b/tests/src/Unit/Integration/RulesAction/RulesComponentActionTest.php index d9e565a01bcc81da772ddfa23eb1a284a788e3c4..af10183a044a869a7a1e3d1fdafd57f4e9ac9cec 100644 --- a/tests/src/Unit/Integration/RulesAction/RulesComponentActionTest.php +++ b/tests/src/Unit/Integration/RulesAction/RulesComponentActionTest.php @@ -20,7 +20,7 @@ class RulesComponentActionTest extends RulesEntityIntegrationTestBase { /** * Tests that a rule can be used as action. */ - public function testActionAvailable() { + public function testActionAvailable(): void { $rule = $this->rulesExpressionManager->createRule(); $rules_config = new RulesComponentConfig([ @@ -39,7 +39,7 @@ class RulesComponentActionTest extends RulesEntityIntegrationTestBase { /** * Tests that the execution of the action invokes the Rules component. */ - public function testExecute() { + public function testExecute(): void { // Set up a rules component that will just save an entity. $nested_rule = $this->rulesExpressionManager->createRule(); $nested_rule->addAction('rules_entity_save', ContextConfig::create() @@ -74,7 +74,7 @@ class RulesComponentActionTest extends RulesEntityIntegrationTestBase { /** * Tests that context definitions are available on the derived action. */ - public function testContextDefinitions() { + public function testContextDefinitions(): void { $rule = $this->rulesExpressionManager->createRule(); $rule ->addAction('rules_entity_save', ContextConfig::create() @@ -105,7 +105,7 @@ class RulesComponentActionTest extends RulesEntityIntegrationTestBase { /** * Tests that a rules component in an action can also provide variables. */ - public function testExecutionProvidedVariables() { + public function testExecutionProvidedVariables(): void { // Create a rule that produces a provided string variable. $nested_rule = $this->rulesExpressionManager->createRule(); $nested_rule->addAction('rules_test_string', ContextConfig::create() @@ -135,7 +135,7 @@ class RulesComponentActionTest extends RulesEntityIntegrationTestBase { /** * Tests that auto saving is only triggered once with nested components. */ - public function testAutosaveOnlyOnce() { + public function testAutosaveOnlyOnce(): void { $entity = $this->prophesizeEntity(EntityInterface::class); $nested_rule = $this->rulesExpressionManager->createRule(); diff --git a/tests/src/Unit/Integration/RulesAction/SendAccountEmailTest.php b/tests/src/Unit/Integration/RulesAction/SendAccountEmailTest.php index a5c8befa4373fa42f3797ade31d5b7aa6a002e6d..19c9961fe5b202521133d3111829fe41fb856a6b 100644 --- a/tests/src/Unit/Integration/RulesAction/SendAccountEmailTest.php +++ b/tests/src/Unit/Integration/RulesAction/SendAccountEmailTest.php @@ -48,7 +48,7 @@ namespace Drupal\Tests\rules\Unit\Integration\RulesAction { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Send account email', $this->action->summary()); } @@ -57,7 +57,7 @@ namespace Drupal\Tests\rules\Unit\Integration\RulesAction { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $account = $this->prophesizeEntity(UserInterface::class); $account->mail = 'klausi@example.com'; $mail_type = 'test_mail_type'; diff --git a/tests/src/Unit/Integration/RulesAction/SystemEmailToUsersOfRoleTest.php b/tests/src/Unit/Integration/RulesAction/SystemEmailToUsersOfRoleTest.php index 3dca897d4662a63a467e3210c23b42da3ea908c5..31038a469c04c8155f5f7b9877d929d1c49048df 100644 --- a/tests/src/Unit/Integration/RulesAction/SystemEmailToUsersOfRoleTest.php +++ b/tests/src/Unit/Integration/RulesAction/SystemEmailToUsersOfRoleTest.php @@ -90,7 +90,7 @@ class SystemEmailToUsersOfRoleTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Send email to all users of a role', $this->action->summary()); } @@ -99,7 +99,7 @@ class SystemEmailToUsersOfRoleTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testSendMailToOneRoles() { + public function testSendMailToOneRoles(): void { // Mock the 'recipient' user role. $recipient = $this->prophesize(RoleInterface::class); $recipient->id()->willReturn('recipient'); @@ -142,7 +142,7 @@ class SystemEmailToUsersOfRoleTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testSendMailToTwoRoles() { + public function testSendMailToTwoRoles(): void { // Mock the 'recipient' and 'moderator' roles. $recipient = $this->prophesize(RoleInterface::class); $recipient->id()->willReturn('recipient'); diff --git a/tests/src/Unit/Integration/RulesAction/SystemMessageTest.php b/tests/src/Unit/Integration/RulesAction/SystemMessageTest.php index 0524090f729f950a07124e7370c452ebc1333737..0f10674598699f8a86524abe79793aa991074cc5 100644 --- a/tests/src/Unit/Integration/RulesAction/SystemMessageTest.php +++ b/tests/src/Unit/Integration/RulesAction/SystemMessageTest.php @@ -35,7 +35,7 @@ class SystemMessageTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Show a message on the site', $this->action->summary()); } @@ -44,7 +44,7 @@ class SystemMessageTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { $this->action->setContextValue('message', 'test message') ->setContextValue('type', MessengerInterface::TYPE_STATUS) ->setContextValue('repeat', FALSE); @@ -74,7 +74,7 @@ class SystemMessageTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testOptionalRepeat() { + public function testOptionalRepeat(): void { $this->action->setContextValue('message', 'test message') ->setContextValue('type', MessengerInterface::TYPE_STATUS); diff --git a/tests/src/Unit/Integration/RulesAction/SystemPageRedirectTest.php b/tests/src/Unit/Integration/RulesAction/SystemPageRedirectTest.php index 6db49729fd8ac4718558d5f54257cd4cabff99f6..e54809bae0102b2affe253e2e86574e04e09031f 100644 --- a/tests/src/Unit/Integration/RulesAction/SystemPageRedirectTest.php +++ b/tests/src/Unit/Integration/RulesAction/SystemPageRedirectTest.php @@ -96,7 +96,7 @@ namespace Drupal\Tests\rules\Unit\Integration\RulesAction { * * @covers ::execute */ - public function testRedirect() { + public function testRedirect(): void { $this->currentPathStack->getPath()->willReturn('some/random/test/path'); $this->action->setContextValue('url', '/test/url'); @@ -110,7 +110,7 @@ namespace Drupal\Tests\rules\Unit\Integration\RulesAction { * * @covers ::execute */ - public function testRedirectBatch() { + public function testRedirectBatch(): void { $this->currentPathStack->getPath()->willReturn('some/random/test/path'); batch_set('Test batch!'); @@ -125,7 +125,7 @@ namespace Drupal\Tests\rules\Unit\Integration\RulesAction { * * @covers ::execute */ - public function testRedirectRulesAdminPage() { + public function testRedirectRulesAdminPage(): void { $this->currentPathStack->getPath()->willReturn('admin/config/workflow/rules'); $this->action->setContextValue('url', '/test/url'); diff --git a/tests/src/Unit/Integration/RulesAction/SystemSendEmailTest.php b/tests/src/Unit/Integration/RulesAction/SystemSendEmailTest.php index 320d56bb1d380fec7bb837fa859ac5ca0cb02ee1..db0b7cc0418fb0931f4f5bc482323c444c92f261 100644 --- a/tests/src/Unit/Integration/RulesAction/SystemSendEmailTest.php +++ b/tests/src/Unit/Integration/RulesAction/SystemSendEmailTest.php @@ -54,7 +54,7 @@ class SystemSendEmailTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Send email', $this->action->summary()); } @@ -63,7 +63,7 @@ class SystemSendEmailTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testSendMailToOneRecipient() { + public function testSendMailToOneRecipient(): void { $to = ['mail@example.com']; $this->action->setContextValue('to', $to) ->setContextValue('subject', 'subject') @@ -96,7 +96,7 @@ class SystemSendEmailTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testSendMailToTwoRecipients() { + public function testSendMailToTwoRecipients(): void { $to = ['mail@example.com', 'mail2@example.com']; // Use a language other than the site default. diff --git a/tests/src/Unit/Integration/RulesAction/UnBanIpTest.php b/tests/src/Unit/Integration/RulesAction/UnBanIpTest.php index 4118f7bb580077d0151a14f76c68952b2f8627f4..c9cb934a301b5b20b687d19a9830aa1c3b05c408 100644 --- a/tests/src/Unit/Integration/RulesAction/UnBanIpTest.php +++ b/tests/src/Unit/Integration/RulesAction/UnBanIpTest.php @@ -77,7 +77,7 @@ class UnBanIpTest extends RulesIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Remove the ban on an IP address', $this->action->summary()); } @@ -91,7 +91,7 @@ class UnBanIpTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithContextIpv4() { + public function testActionExecutionWithContextIpv4(): void { // TEST-NET-1 IPv4. $ipv4 = '192.0.2.0'; $this->action->setContextValue('ip', $ipv4); @@ -113,7 +113,7 @@ class UnBanIpTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithContextIpv6() { + public function testActionExecutionWithContextIpv6(): void { // TEST-NET-1 IPv4 '192.0.2.0' converted to IPv6. $ipv6 = '2002:0:0:0:0:0:c000:200'; $this->action->setContextValue('ip', $ipv6); @@ -132,7 +132,7 @@ class UnBanIpTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testActionExecutionWithoutContextIp() { + public function testActionExecutionWithoutContextIp(): void { // TEST-NET-1 IPv4. $ip = '192.0.2.0'; diff --git a/tests/src/Unit/Integration/RulesAction/UserBlockTest.php b/tests/src/Unit/Integration/RulesAction/UserBlockTest.php index 51c93a253430009e558aa92876f993893dc2ca9a..f6011b9becef3b85706fd9690789c94ed4c14d7a 100644 --- a/tests/src/Unit/Integration/RulesAction/UserBlockTest.php +++ b/tests/src/Unit/Integration/RulesAction/UserBlockTest.php @@ -63,7 +63,7 @@ class UserBlockTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Block a user', $this->action->summary()); } @@ -72,7 +72,7 @@ class UserBlockTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testBlockUserWithValidUser() { + public function testBlockUserWithValidUser(): void { $user = $this->getUserMock(self::ACTIVE, self::AUTHENTICATED); $user->block()->shouldBeCalledTimes(1); @@ -93,7 +93,7 @@ class UserBlockTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testBlockUserWithActiveAnonymousUser() { + public function testBlockUserWithActiveAnonymousUser(): void { $user = $this->getUserMock(self::ACTIVE, self::ANONYMOUS); $user->block()->shouldNotBeCalled(); @@ -112,7 +112,7 @@ class UserBlockTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testBlockUserWithBlockedAuthenticatedUser() { + public function testBlockUserWithBlockedAuthenticatedUser(): void { $user = $this->getUserMock(self::BLOCKED, self::AUTHENTICATED); $user->block()->shouldNotBeCalled(); @@ -131,7 +131,7 @@ class UserBlockTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testBlockUserWithBlockedAnonymousUser() { + public function testBlockUserWithBlockedAnonymousUser(): void { $user = $this->getUserMock(self::BLOCKED, self::ANONYMOUS); $user->block()->shouldNotBeCalled(); diff --git a/tests/src/Unit/Integration/RulesAction/UserRoleAddTest.php b/tests/src/Unit/Integration/RulesAction/UserRoleAddTest.php index 3fbded3cb759cd27b5db1b9fc26966f5704e91f1..a192ebbc3f44a981baa7c8b1bad01ac2a6386721 100644 --- a/tests/src/Unit/Integration/RulesAction/UserRoleAddTest.php +++ b/tests/src/Unit/Integration/RulesAction/UserRoleAddTest.php @@ -34,7 +34,7 @@ class UserRoleAddTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Add user role', $this->action->summary()); } @@ -43,7 +43,7 @@ class UserRoleAddTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testAddOneRoleNoSave() { + public function testAddOneRoleNoSave(): void { // Set-up a mock user. $account = $this->prophesizeEntity(UserInterface::class); @@ -71,7 +71,7 @@ class UserRoleAddTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testAddThreeRoles() { + public function testAddThreeRoles(): void { // Set-up a mock user. $account = $this->prophesizeEntity(UserInterface::class); // Mock hasRole. @@ -110,7 +110,7 @@ class UserRoleAddTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testAddExistingRole() { + public function testAddExistingRole(): void { // Set-up a mock user with role 'administrator'. $account = $this->prophesizeEntity(UserInterface::class); $account->hasRole('administrator')->willReturn(TRUE); @@ -136,7 +136,7 @@ class UserRoleAddTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testAddExistingAndNonexistentRole() { + public function testAddExistingAndNonexistentRole(): void { // Set-up a mock user with role 'administrator' but without 'editor'. $account = $this->prophesizeEntity(UserInterface::class); $account->hasRole('administrator')->willReturn(TRUE) diff --git a/tests/src/Unit/Integration/RulesAction/UserRoleRemoveTest.php b/tests/src/Unit/Integration/RulesAction/UserRoleRemoveTest.php index f9cef5815be1098434fd247ccad50f24ee3092fe..c3ddcd5879deb2b8c7f7423c5d2faf8480c85bb6 100644 --- a/tests/src/Unit/Integration/RulesAction/UserRoleRemoveTest.php +++ b/tests/src/Unit/Integration/RulesAction/UserRoleRemoveTest.php @@ -33,7 +33,7 @@ class UserRoleRemoveTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Remove user role', $this->action->summary()); } @@ -42,7 +42,7 @@ class UserRoleRemoveTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testRemoveExistingRoleNoSave() { + public function testRemoveExistingRoleNoSave(): void { // Set-up a mock user with role 'editor'. $account = $this->prophesizeEntity(UserInterface::class); @@ -71,7 +71,7 @@ class UserRoleRemoveTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testRemoveNonExistingRole() { + public function testRemoveNonExistingRole(): void { // Set-up a mock user with role 'editor'. $account = $this->prophesizeEntity(UserInterface::class); diff --git a/tests/src/Unit/Integration/RulesAction/UserUnblockTest.php b/tests/src/Unit/Integration/RulesAction/UserUnblockTest.php index 6e01fb124c9bcd19015f631c41108ae303504a11..c524a22a9625b2dde2cf9718ec13a3801a8cf2df 100644 --- a/tests/src/Unit/Integration/RulesAction/UserUnblockTest.php +++ b/tests/src/Unit/Integration/RulesAction/UserUnblockTest.php @@ -52,7 +52,7 @@ class UserUnblockTest extends RulesEntityIntegrationTestBase { * * @covers ::summary */ - public function testSummary() { + public function testSummary(): void { $this->assertEquals('Unblock a user', $this->action->summary()); } @@ -63,7 +63,7 @@ class UserUnblockTest extends RulesEntityIntegrationTestBase { * * @covers ::execute */ - public function testUnblockUser($active, $authenticated, $expects, $autosave_names) { + public function testUnblockUser(bool $active, bool $authenticated, int $expects, array $autosave_names): void { // Set-up a mock user. $account = $this->prophesizeEntity(UserInterface::class); // Mock isBlocked. diff --git a/tests/src/Unit/Integration/RulesAction/VariableAddTest.php b/tests/src/Unit/Integration/RulesAction/VariableAddTest.php index 4dc98d873120628cf8ab58c68edf3233b3eea064..5b14a81c18618415678890608473ec89c3a727c7 100644 --- a/tests/src/Unit/Integration/RulesAction/VariableAddTest.php +++ b/tests/src/Unit/Integration/RulesAction/VariableAddTest.php @@ -15,7 +15,7 @@ class VariableAddTest extends RulesIntegrationTestBase { * * @covers ::execute */ - public function testExecute() { + public function testExecute(): void { $variable = 'test string'; /** @var \Drupal\rules\Plugin\RulesAction\VariableAdd $action */ diff --git a/tests/src/Unit/Integration/RulesEntityIntegrationTestBase.php b/tests/src/Unit/Integration/RulesEntityIntegrationTestBase.php index b648bac446ef334c31ecff3d6ee0a82e5b746bac..3574c04ee987a529e79a38b21356101e1c83219d 100644 --- a/tests/src/Unit/Integration/RulesEntityIntegrationTestBase.php +++ b/tests/src/Unit/Integration/RulesEntityIntegrationTestBase.php @@ -11,6 +11,7 @@ use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\TypedData\TypedDataManagerInterface; use Drupal\rules\Context\ContextDefinition; +use Drupal\rules\Context\ContextDefinitionInterface; use Prophecy\Argument; use Prophecy\Prophecy\ProphecyInterface; @@ -146,10 +147,10 @@ abstract class RulesEntityIntegrationTestBase extends RulesIntegrationTestBase { * @param \Prophecy\Prophecy\ProphecyInterface $data_definition * A prophecy that represents a data definition object. * - * @return \Drupal\rules\Context\ContextDefinition + * @return \Drupal\rules\Context\ContextDefinitionInterface * The context definition with the data definition prophecy in it. */ - protected function getContextDefinitionFor($data_type, ProphecyInterface $data_definition) { + protected function getContextDefinitionFor(string $data_type, ProphecyInterface $data_definition): ContextDefinitionInterface { // Mock all the setter calls on the data definition that can be ignored. $data_definition->setLabel(Argument::any())->willReturn($data_definition->reveal()); $data_definition->setDescription(Argument::any())->willReturn($data_definition->reveal()); diff --git a/tests/src/Unit/Integration/RulesIntegrationTestBase.php b/tests/src/Unit/Integration/RulesIntegrationTestBase.php index f1da258e461adce0ba70ff39393e25acb9f291c1..7793d77441ed505a1e91c6887c4fa7562a157f82 100644 --- a/tests/src/Unit/Integration/RulesIntegrationTestBase.php +++ b/tests/src/Unit/Integration/RulesIntegrationTestBase.php @@ -16,6 +16,7 @@ use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Field\FieldTypeCategoryManager; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\Core\Plugin\Context\LazyContextRepository; +use Drupal\Core\TypedData\TypedDataInterface; use Drupal\Core\TypedData\TypedDataManager; use Drupal\rules\Core\ConditionManager; use Drupal\rules\Context\DataProcessorManager; @@ -279,7 +280,7 @@ abstract class RulesIntegrationTestBase extends UnitTestCase { * @param array $namespaces * Map of the association between module's namespaces and filesystem paths. */ - protected function enableModule($name, array $namespaces = []) { + protected function enableModule(string $name, array $namespaces = []): void { $this->enabledModules[$name] = TRUE; if (empty($namespaces)) { @@ -302,7 +303,7 @@ abstract class RulesIntegrationTestBase extends UnitTestCase { * * @see \Drupal\Core\Extension\ExtensionDiscovery */ - protected function constructModulePath($module) { + protected function constructModulePath(string $module) { // Use Unix paths regardless of platform, skip dot directories, follow // symlinks (to allow extensions to be linked from elsewhere), and return // the RecursiveDirectoryIterator instance to have access to getSubPath(), @@ -347,7 +348,7 @@ abstract class RulesIntegrationTestBase extends UnitTestCase { * @return \Drupal\Core\TypedData\TypedDataInterface * The created object. */ - protected function getTypedData($data_type, $value) { + protected function getTypedData(string $data_type, mixed $value): TypedDataInterface { $definition = $this->typedDataManager->createDataDefinition($data_type); $data = $this->typedDataManager->create($definition); $data->setValue($value); @@ -363,7 +364,7 @@ abstract class RulesIntegrationTestBase extends UnitTestCase { * @return \Drupal\Core\Entity\EntityInterface|\Prophecy\Prophecy\ProphecyInterface * The mocked entity. */ - protected function prophesizeEntity($interface) { + protected function prophesizeEntity(string $interface) { $entity = $this->prophesize($interface); // Cache methods are irrelevant for the tests but might be called. $entity->getCacheContexts()->willReturn([]); diff --git a/tests/src/Unit/OrExpressionTest.php b/tests/src/Unit/OrExpressionTest.php index 0158c276a9cf591dcfc1264116d8d90b592860c9..30db17e693ba9701ea70a1113e77322cfcb31507 100644 --- a/tests/src/Unit/OrExpressionTest.php +++ b/tests/src/Unit/OrExpressionTest.php @@ -32,7 +32,7 @@ class OrExpressionTest extends RulesUnitTestBase { /** * Tests one condition. */ - public function testOneCondition() { + public function testOneCondition(): void { // The method on the test condition must be called once. $this->trueConditionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -44,7 +44,7 @@ class OrExpressionTest extends RulesUnitTestBase { /** * Tests an empty OR. */ - public function testEmptyOr() { + public function testEmptyOr(): void { $property = new \ReflectionProperty($this->or, 'conditions'); $property->setAccessible(TRUE); @@ -55,7 +55,7 @@ class OrExpressionTest extends RulesUnitTestBase { /** * Tests two true conditions. */ - public function testTwoConditions() { + public function testTwoConditions(): void { // The method on the test condition must be called once. $this->trueConditionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -78,7 +78,7 @@ class OrExpressionTest extends RulesUnitTestBase { /** * Tests two false conditions. */ - public function testTwoFalseConditions() { + public function testTwoFalseConditions(): void { // The method on the test condition must be called once. $this->falseConditionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); diff --git a/tests/src/Unit/RuleExpressionTest.php b/tests/src/Unit/RuleExpressionTest.php index 7e860d5cb19e87b5e339bfab60fe058d48ba618d..2b7f9f2de85baeabcae0cc5270a72e6003b9963b 100644 --- a/tests/src/Unit/RuleExpressionTest.php +++ b/tests/src/Unit/RuleExpressionTest.php @@ -68,7 +68,7 @@ class RuleExpressionTest extends RulesUnitTestBase { * * @covers ::__construct */ - public function testContainersOnConstruct() { + public function testContainersOnConstruct(): void { $this->assertSame($this->conditions, $this->rule->getConditions()); $this->assertSame($this->actions, $this->rule->getActions()); } @@ -79,7 +79,7 @@ class RuleExpressionTest extends RulesUnitTestBase { * @covers ::setConditions * @covers ::getConditions */ - public function testSetConditionsGetConditions() { + public function testSetConditionsGetConditions(): void { $or = new OrExpression([], 'rules_or', ['label' => 'Condition set (OR)'], $this->expressionManager->reveal(), $this->rulesDebugLogger->reveal()); $this->rule->setConditions($or); $this->assertSame($or, $this->rule->getConditions()); @@ -95,7 +95,7 @@ class RuleExpressionTest extends RulesUnitTestBase { * @covers ::setActions * @covers ::getActions */ - public function testSetActionsGetActions() { + public function testSetActionsGetActions(): void { $action_set = new ActionSetExpression([], '', [], $this->expressionManager->reveal(), $this->rulesDebugLogger->reveal()); $this->rule->setActions($action_set); $this->assertSame($action_set, $this->rule->getActions()); @@ -106,7 +106,7 @@ class RuleExpressionTest extends RulesUnitTestBase { * * @covers ::execute */ - public function testActionExecution() { + public function testActionExecution(): void { // The method on the test action must be called once. $this->testActionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -122,7 +122,7 @@ class RuleExpressionTest extends RulesUnitTestBase { * * @covers ::execute */ - public function testConditionFails() { + public function testConditionFails(): void { // The execute method on the action must never be called. $this->testActionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldNotBeCalled(); @@ -138,7 +138,7 @@ class RuleExpressionTest extends RulesUnitTestBase { * * @covers ::execute */ - public function testTwoConditionsTrue() { + public function testTwoConditionsTrue(): void { // The method on the test action must be called once. $this->testActionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -164,7 +164,7 @@ class RuleExpressionTest extends RulesUnitTestBase { * * @covers ::execute */ - public function testTwoConditionsFalse() { + public function testTwoConditionsFalse(): void { // The execute method on the action must never be called. $this->testActionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldNotBeCalled(); @@ -185,7 +185,7 @@ class RuleExpressionTest extends RulesUnitTestBase { * * @covers ::execute */ - public function testNestedRules() { + public function testNestedRules(): void { $this->testActionExpression->executeWithState( Argument::type(ExecutionStateInterface::class))->shouldBeCalledTimes(1); @@ -207,7 +207,7 @@ class RuleExpressionTest extends RulesUnitTestBase { /** * Tests that a nested expression can be retrieved by UUID. */ - public function testLookupExpression() { + public function testLookupExpression(): void { // Test Conditions. $this->rule->addExpressionObject($this->trueConditionExpression->reveal()); $uuid = $this->trueConditionExpression->reveal()->getUuid(); @@ -224,7 +224,7 @@ class RuleExpressionTest extends RulesUnitTestBase { /** * Tests that removing expressions by indices works. */ - public function testDeletingExpressions() { + public function testDeletingExpressions(): void { // Create a rule with 2 conditions and 2 actions. $this->rule->addExpressionObject($this->trueConditionExpression->reveal()); $this->rule->addExpressionObject($this->falseConditionExpression->reveal()); diff --git a/tests/src/Unit/RulesActionBaseTest.php b/tests/src/Unit/RulesActionBaseTest.php index d1f607c28d698d50ff843444dee171e9cffe947c..2a67244abcb2476fedffcd3d8b26d44995b5c7f0 100644 --- a/tests/src/Unit/RulesActionBaseTest.php +++ b/tests/src/Unit/RulesActionBaseTest.php @@ -17,7 +17,7 @@ class RulesActionBaseTest extends RulesUnitTestBase { * * @covers ::summary */ - public function testSummaryThrowingException() { + public function testSummaryThrowingException(): void { // Set the expected exception class. There is no message to check for. $this->expectException(InvalidPluginDefinitionException::class); @@ -33,7 +33,7 @@ class RulesActionBaseTest extends RulesUnitTestBase { * * @covers ::summary */ - public function testSummaryParsingTheLabelAnnotation() { + public function testSummaryParsingTheLabelAnnotation(): void { $rules_action_base = $this->getMockForAbstractClass( RulesActionBase::class, [[], '', ['label' => 'something']] @@ -46,7 +46,7 @@ class RulesActionBaseTest extends RulesUnitTestBase { * * @covers ::summary */ - public function testTranslatedLabel() { + public function testTranslatedLabel(): void { $translation_wrapper = $this->prophesize(TranslatableMarkup::class); $translation_wrapper->__toString()->willReturn('something'); $rules_action_base = $this->getMockForAbstractClass( diff --git a/tests/src/Unit/RulesConditionContainerTest.php b/tests/src/Unit/RulesConditionContainerTest.php index d9a52bc40cfc8c79c64dd976df97b2335e2618b4..bcafadc52a2b143ed248fdfa06877b3a408ccaf2 100644 --- a/tests/src/Unit/RulesConditionContainerTest.php +++ b/tests/src/Unit/RulesConditionContainerTest.php @@ -5,6 +5,7 @@ namespace Drupal\Tests\rules\Unit; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\rules\Context\ExecutionStateInterface; use Drupal\rules\Engine\ConditionExpressionContainer; +use Drupal\rules\Engine\ConditionExpressionContainerInterface; use Drupal\rules\Engine\ExpressionManagerInterface; /** @@ -24,7 +25,7 @@ class RulesConditionContainerTest extends RulesUnitTestBase { * @return \Drupal\rules\Engine\ConditionExpressionContainerInterface * The mocked condition container. */ - protected function getMockConditionContainer(array $methods = [], $class = 'RulesConditionContainerMock') { + protected function getMockConditionContainer(array $methods = [], string $class = 'RulesConditionContainerMock'): ConditionExpressionContainerInterface { return $this->getMockForAbstractClass( ConditionExpressionContainer::class, [ [], @@ -41,7 +42,7 @@ class RulesConditionContainerTest extends RulesUnitTestBase { * * @covers ::addExpressionObject */ - public function testAddExpressionObject() { + public function testAddExpressionObject(): void { $container = $this->getMockConditionContainer(); $container->addExpressionObject($this->trueConditionExpression->reveal()); @@ -57,7 +58,7 @@ class RulesConditionContainerTest extends RulesUnitTestBase { * @covers ::negate * @covers ::isNegated */ - public function testNegate() { + public function testNegate(): void { $container = $this->getMockForAbstractClass(RulesConditionContainerTestStub::class, [], '', FALSE); $this->assertFalse($container->isNegated()); @@ -73,7 +74,7 @@ class RulesConditionContainerTest extends RulesUnitTestBase { * * @covers ::execute */ - public function testExecute() { + public function testExecute(): void { $container = $this->getMockForAbstractClass(RulesConditionContainerTestStub::class, [], '', FALSE); $this->assertTrue($container->execute()); } @@ -81,7 +82,7 @@ class RulesConditionContainerTest extends RulesUnitTestBase { /** * Tests that an expression can be retrieved by UUID. */ - public function testLookupExpression() { + public function testLookupExpression(): void { $container = $this->getMockForAbstractClass(RulesConditionContainerTestStub::class, [ [], 'test_id', @@ -98,7 +99,7 @@ class RulesConditionContainerTest extends RulesUnitTestBase { /** * Tests that a nested expression can be retrieved by UUID. */ - public function testLookupNestedExpression() { + public function testLookupNestedExpression(): void { $container = $this->getMockForAbstractClass(RulesConditionContainerTestStub::class, [ [], 'test_id', @@ -126,7 +127,7 @@ class RulesConditionContainerTest extends RulesUnitTestBase { /** * Tests deleting a condition from the container. */ - public function testDeletingCondition() { + public function testDeletingCondition(): void { $container = $this->getMockForAbstractClass(RulesConditionContainerTestStub::class, [ [], 'test_id', @@ -150,7 +151,7 @@ class RulesConditionContainerTest extends RulesUnitTestBase { /** * Tests deleting a nested condition from the container. */ - public function testDeletingNestedCondition() { + public function testDeletingNestedCondition(): void { $container = $this->getMockForAbstractClass(RulesConditionContainerTestStub::class, [ [], 'test_id', @@ -186,7 +187,7 @@ abstract class RulesConditionContainerTestStub extends ConditionExpressionContai /** * {@inheritdoc} */ - public function evaluate(ExecutionStateInterface $state) { + public function evaluate(ExecutionStateInterface $state): bool { return TRUE; } diff --git a/tests/src/Unit/RulesDebugLoggerChannelTest.php b/tests/src/Unit/RulesDebugLoggerChannelTest.php index 15ca2eac274abea8b38c511347dcc756b9d21a7b..a096ea9f589a412f5ec71bf4ab23d16f26abaa58 100644 --- a/tests/src/Unit/RulesDebugLoggerChannelTest.php +++ b/tests/src/Unit/RulesDebugLoggerChannelTest.php @@ -89,7 +89,7 @@ class RulesDebugLoggerChannelTest extends UnitTestCase { * * @covers ::log */ - public function testLog($psr3_message_level, $rfc_message_level, $system_debug, $debug_log_enabled, $psr3_log_error_level, $expect_system_log, $expect_screen_log, $message) { + public function testLog(string $psr3_message_level, int $rfc_message_level, bool $system_debug, bool $debug_log_enabled, string $psr3_log_error_level, int $expect_system_log, int $expect_screen_log, string $message): void { // Clean up after previous test. $this->rulesDebugLog->clearLogs();