public function testCheck() { $result = new Success('Test check', 'OK'); $backend = $this->getMock('Sonata\\NotificationBundle\\Backend\\BackendInterface'); $backend->expects($this->once())->method('getStatus')->will($this->returnValue($result)); $health = new BackendHealthCheck($backend); $this->assertEquals($result, $health->check()); }
public function testCheck() { $status = new BackendStatus(BackendStatus::OK, 'OK'); $backend = $this->getMock('Sonata\\NotificationBundle\\Backend\\BackendInterface'); $backend->expects($this->once())->method('getStatus')->will($this->returnValue($status)); $health = new BackendHealthCheck($backend); $status = $health->check(); $this->assertEquals(BackendStatus::OK, $status->getStatus()); }