コード例 #1
0
 public function testSetDefaultValues()
 {
     $workflowItem = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Entity\\WorkflowItem')->disableOriginalConstructor()->getMock();
     $defaultValues = array('test' => 'value');
     $this->contextAccessor->expects($this->once())->method('getValue')->with($workflowItem, 'value')->will($this->returnValue('testValue'));
     $data = $this->getMockBuilder('Oro\\Bundle\\WorkflowBundle\\Model\\WorkflowData')->disableOriginalConstructor()->getMock();
     $data->expects($this->once())->method('set')->with('test', 'testValue');
     $event = $this->getMockBuilder('Symfony\\Component\\Form\\FormEvent')->disableOriginalConstructor()->getMock();
     $event->expects($this->once())->method('getData')->will($this->returnValue($data));
     $this->listener->initialize($workflowItem, $defaultValues);
     $this->listener->setDefaultValues($event);
 }