function RulesConditionContainerTest::testNegate

Tests negating the result of the condition container.

@covers ::negate @covers ::isNegated

File

tests/src/Unit/RulesConditionContainerTest.php, line 60

Class

RulesConditionContainerTest
@coversDefaultClass \Drupal\rules\Engine\ConditionExpressionContainer @group Rules

Namespace

Drupal\Tests\rules\Unit

Code

public function testNegate() {
    $container = $this->getMockForAbstractClass(RulesConditionContainerTestStub::class, [], '', FALSE);
    $this->assertFalse($container->isNegated());
    $this->assertTrue($container->execute());
    $container->negate(TRUE);
    $this->assertTrue($container->isNegated());
    $this->assertFalse($container->execute());
}