Skip to content
Snippets Groups Projects
Commit 8b448bcf authored by Tim Rohaly's avatar Tim Rohaly Committed by Tim Rohaly
Browse files

Issue #3253921 by TR: Use assertCount() instead of...

Issue #3253921 by TR: Use assertCount() instead of assertEqual()/assertEquals() in tests where appropriate
parent 5c719ce6
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,7 @@ class IntegrityCheckTest extends RulesEntityIntegrationTestBase {
$this->assertEquals(2, iterator_count($all_violations));
$uuid_violations = $all_violations->getFor($second_action->getUuid());
$this->assertEquals(1, count($uuid_violations));
$this->assertCount(1, $uuid_violations);
$violation = $uuid_violations[0];
// The Exception message part of the output should be HTML-escaped.
$this->assertEquals(
......
......@@ -241,26 +241,26 @@ class RuleExpressionTest extends RulesUnitTestBase {
// Delete the first action.
$uuid = $this->testActionExpression->reveal()->getUuid();
$this->rule->deleteExpression($uuid);
$this->assertEquals(2, count($this->rule->getConditions()->getIterator()));
$this->assertEquals(1, count($this->rule->getActions()->getIterator()));
$this->assertCount(2, $this->rule->getConditions()->getIterator());
$this->assertCount(1, $this->rule->getActions()->getIterator());
// Delete the second condition.
$uuid = $this->falseConditionExpression->reveal()->getUuid();
$this->rule->deleteExpression($uuid);
$this->assertEquals(1, count($this->rule->getConditions()->getIterator()));
$this->assertEquals(1, count($this->rule->getActions()->getIterator()));
$this->assertCount(1, $this->rule->getConditions()->getIterator());
$this->assertCount(1, $this->rule->getActions()->getIterator());
// Delete the remaining action.
$uuid = $second_action->reveal()->getUuid();
$this->rule->deleteExpression($uuid);
$this->assertEquals(1, count($this->rule->getConditions()->getIterator()));
$this->assertEquals(0, count($this->rule->getActions()->getIterator()));
$this->assertCount(1, $this->rule->getConditions()->getIterator());
$this->assertCount(0, $this->rule->getActions()->getIterator());
// Delete the remaining condition, rule should be empty now.
$uuid = $this->trueConditionExpression->reveal()->getUuid();
$this->rule->deleteExpression($uuid);
$this->assertEquals(0, count($this->rule->getConditions()->getIterator()));
$this->assertEquals(0, count($this->rule->getActions()->getIterator()));
$this->assertCount(0, $this->rule->getConditions()->getIterator());
$this->assertCount(0, $this->rule->getActions()->getIterator());
}
}
......@@ -173,7 +173,7 @@ class RulesConditionContainerTest extends RulesUnitTestBase {
$uuid = $this->falseConditionExpression->reveal()->getUuid();
$this->assertTrue($container->deleteExpression($uuid));
$this->assertEquals(0, count($nested_container->getIterator()));
$this->assertCount(0, $nested_container->getIterator());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment