Beispiel #1
0
 public function testIsAllowed()
 {
     $context = new \stdClass();
     $path = 'path';
     $expectedValue = true;
     $this->contextAccessor->expects($this->once())->method('hasValue')->with($context, $path)->will($this->returnValue($expectedValue));
     $this->condition->initialize(array($path));
     $this->assertEquals($expectedValue, $this->condition->isAllowed($context));
 }
Beispiel #2
0
 public function testIsAllowed()
 {
     $context = array('foo');
     $this->hasValue->expects($this->once())->method('isAllowed')->with($context);
     $this->condition->isAllowed($context);
 }
Beispiel #3
0
 /**
  * @dataProvider isAllowedDataProvider
  *
  * @param array $options
  * @param $context
  * @param $expectedResult
  */
 public function testIsAllowed(array $options, $context, $expectedResult)
 {
     $this->condition->initialize($options);
     $this->assertEquals($expectedResult, $this->condition->isAllowed($context));
 }