RefinableDependentAccessTraitTestClass example

$this->neutral = $this->createAccessibleDouble(AccessResult::neutral('I have no opinion'));
  }

  /** * Tests that the previous dependency is replaced when using set. * * @covers ::setAccessDependency * * @dataProvider providerTestSetFirst */
  public function testSetAccessDependency($use_set_first) {
    $testRefinable = new RefinableDependentAccessTraitTestClass();

    if ($use_set_first) {
      $testRefinable->setAccessDependency($this->forbidden);
    }
    else {
      $testRefinable->addAccessDependency($this->forbidden);
    }
    $accessResult = $testRefinable->getAccessDependency()->access('view', $this->account, TRUE);
    $this->assertTrue($accessResult->isForbidden());
    $this->assertEquals('Because I said so', $accessResult->getReason());

    
Home | Imprint | This part of the site doesn't use cookies.