/** * @return JsonModel */ public function notifyAction() { $this->guardValidHash(); $format = $this->config->getNotify()->getFormat(); $rawData = $this->params()->fromPost($format); $data = $this->parseData($format, $rawData); $this->notifyService->notify($data); return new JsonModel(['success' => true]); }
/** * @test */ public function it_should_retrieve_encoding_notification() { $xml = '<root><item>value</item></root>'; $this->mockParam('route', 'hash', 'hash'); $this->mockParam('post', 'xml', $xml); $this->notifyService->expects($this->once())->method('notify')->with(new \SimpleXMLElement($xml)); $result = $this->controller->notifyAction(); $this->assertEquals($result->getVariable('success'), true); }