TestConditionAccessResolverTrait example


class ConditionAccessResolverTraitTest extends UnitTestCase {

  /** * Tests the resolveConditions() method. * * @covers ::resolveConditions * * @dataProvider providerTestResolveConditions */
  public function testResolveConditions($conditions$logic$expected) {
    $trait_object = new TestConditionAccessResolverTrait();
    $this->assertEquals($expected$trait_object->resolveConditions($conditions$logic));
  }

  public function providerTestResolveConditions() {
    $data = [];

    $condition_true = $this->createMock('Drupal\Core\Condition\ConditionInterface');
    $condition_true->expects($this->any())
      ->method('execute')
      ->willReturn(TRUE);
    $condition_false = $this->createMock('Drupal\Core\Condition\ConditionInterface');
    
Home | Imprint | This part of the site doesn't use cookies.