Example #1
0
 public function testOnEmbeddedFormSubmitWithDataChannel()
 {
     $formEntity = $this->getMockBuilder('OroCRM\\Bundle\\ChannelBundle\\Tests\\Unit\\Stubs\\Entity\\EmbeddedFormStub')->disableOriginalConstructor()->getMock();
     $dataChannel = $this->getMock('OroCRM\\Bundle\\ChannelBundle\\Entity\\Channel');
     $formEntity->expects($this->once())->method('getDataChannel')->will($this->returnValue($dataChannel));
     $data = $this->getMock('OroCRM\\Bundle\\ChannelBundle\\Model\\ChannelAwareInterface');
     $data->expects($this->once())->method('setDataChannel');
     $event = new EmbeddedFormSubmitBeforeEvent($data, $formEntity);
     $listener = new EmbeddedFormListener($this->request);
     $listener->onEmbeddedFormSubmit($event);
 }