public function itReconstitutesANotEmptyCondition() { $xml = new SimpleXMLElement(' <condition type="notempty"> <field REF="F14"/> </condition> '); $expected = new Workflow_Transition_Condition_FieldNotEmpty($this->transition, $this->dao); $expected->setField($this->field_string); $condition = $this->factory->getInstanceFromXML($xml, $this->xml_mapping, $this->transition); $this->assertEqual($condition, $expected); }
public function getInstanceFromXML($xml, &$xmlMapping, Transition $transition) { $condition = null; if (isset($xml->field)) { $xml_field = $xml->field; $xml_field_attributes = $xml_field->attributes(); $field = $xmlMapping[(string) $xml_field_attributes['REF']]; $condition = new Workflow_Transition_Condition_FieldNotEmpty($transition, $this->dao); $condition->setField($field); } return $condition; }