Example #1
0
 /**
  * Testcase Constructor.
  *
  * @return void
  */
 public function setUpError()
 {
     $this->logger = $this->getMock('Psr\\Log\\LoggerInterface');
     $response = FALSE;
     $this->logger->expects($this->once())->method('warning')->with($this->equalTo('Sending email notification to {endpoint} failed.'), $this->equalTo(['endpoint' => '12345679']));
     $this->class = new EmailResponse($response, $this->logger, '12345679');
     $this->reflection = new ReflectionClass('Lunr\\Vortex\\Email\\EmailResponse');
 }
Example #2
0
 /**
  * Testcase Constructor.
  *
  * @return void
  */
 public function setUpInvalidXMLError()
 {
     $this->logger = $this->getMock('Psr\\Log\\LoggerInterface');
     $response = $this->getMockBuilder('Lunr\\Network\\CurlResponse')->disableOriginalConstructor()->getMock();
     $response->expects($this->once())->method('get_network_error_number')->will($this->returnValue(0));
     $map = [['http_code', 200]];
     $response->expects($this->exactly(1))->method('__get')->will($this->returnValueMap($map));
     $this->logger->expects($this->once())->method('warning')->with($this->equalTo('Parsing response of push notification to {endpoint} failed: {error}'), $this->equalTo(['error' => 'Invalid document end', 'endpoint' => '12345679']));
     $this->class = new PAPResponse($response, $this->logger, '12345679');
     $this->reflection = new ReflectionClass('Lunr\\Vortex\\PAP\\PAPResponse');
 }
Example #3
0
 /**
  * Testcase Constructor.
  *
  * @return void
  */
 public function setUpError()
 {
     $this->logger = $this->getMock('Psr\\Log\\LoggerInterface');
     $response = $this->getMockBuilder('Lunr\\Network\\CurlResponse')->disableOriginalConstructor()->getMock();
     $response->expects($this->once())->method('get_network_error_number')->will($this->returnValue(-1));
     $response->expects($this->once())->method('get_network_error_message')->will($this->returnValue('Error Message'));
     $map = [['http_code', 503]];
     $response->expects($this->exactly(1))->method('__get')->will($this->returnValueMap($map));
     $this->logger->expects($this->once())->method('warning')->with($this->equalTo('Dispatching push notification to {endpoint} failed: {error}'), $this->equalTo(['error' => 'Error Message', 'endpoint' => '12345679']));
     $this->class = new GCMResponse($response, $this->logger, '12345679');
     $this->reflection = new ReflectionClass('Lunr\\Vortex\\GCM\\GCMResponse');
 }