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)); }
public function testIsAllowed() { $context = array('foo'); $this->hasValue->expects($this->once())->method('isAllowed')->with($context); $this->condition->isAllowed($context); }
/** * @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)); }