Пример #1
0
    public function testUnknownCode()
    {
        $response_str = $this->readResponse('response_unknown');
        $response = Response::fromString($response_str);

        // Check that dynamically the message is parsed
        $this->assertEquals(550, $response->getStatus(), 'Status is expected to be a non-standard 550');
        $this->assertEquals('Printer On Fire', $response->getMessage(), 'Message is expected to be extracted');

        // Check that statically, an Unknown string is returned for the 550 code
        $this->assertEquals('Unknown', Response::responseCodeAsText($response_str));
    }