public function testIsAllowedFalse() { $currentConditionError = 'Current condition error'; $nestedConditionError = 'Nested condition error'; $this->condition->setMessage($currentConditionError); $falseConditionWithError = new Condition\False(); $falseConditionWithError->setMessage($nestedConditionError); $this->condition->initialize(array(new Condition\True(), $falseConditionWithError)); $errors = new ArrayCollection(); $this->assertFalse($this->condition->isAllowed('anything', $errors)); $this->assertEquals(2, $errors->count()); $this->assertEquals(array('message' => $nestedConditionError, 'parameters' => array()), $errors->get(0)); $this->assertEquals(array('message' => $currentConditionError, 'parameters' => array()), $errors->get(1)); }
/** * @expectedException \Oro\Bundle\WorkflowBundle\Exception\ConditionException * @expectedExceptionMessage Options are prohibited */ public function testInitializeFails() { $this->condition->initialize(array('anything')); }