Created
December 23, 2014 08:56
-
-
Save jubianchi/81242e7d93532db6da3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace mageekguy\atoum\http\tests\functionals\tests\fixtures; | |
use mageekguy\atoum\http\tests\fixtures\body; | |
use mageekguy\atoum\http\tests\functional; | |
class message extends functional | |
{ | |
public function testProtocol() | |
{ | |
$this | |
->given( | |
$protocol = uniqid(), | |
$this->newTestedInstance($protocol, array(), new body(uniqid())) | |
) | |
->then | |
->message($this->testedInstance) | |
->protocol->isEqualTo($protocol) | |
; | |
} | |
public function testBody() | |
{ | |
$this | |
->given( | |
$body = uniqid(), | |
$this->newTestedInstance(uniqid(), array(), new body($body)) | |
) | |
->then | |
->message($this->testedInstance) | |
->body->isEqualTo($body) | |
; | |
} | |
public function testHeaders() | |
{ | |
$this | |
->given( | |
$header = uniqid(), | |
$value = uniqid(), | |
$this->newTestedInstance(uniqid(), array($header => $value), new body(uniqid())) | |
) | |
->then | |
->message($this->testedInstance) | |
->headers | |
->has($header) | |
->string[$header]->isEqualTo($value) | |
; | |
} | |
public function testAll() | |
{ | |
$this | |
->given( | |
$protocol = uniqid(), | |
$header = uniqid(), | |
$value = uniqid(), | |
$body = uniqid(), | |
$this->newTestedInstance($protocol, array($header => $value), new body($body)) | |
) | |
->then | |
->message($this->testedInstance) | |
->protocol->isEqualTo($protocol) | |
->body->isEqualTo($body) | |
->headers | |
->string[$header]->isEqualTo($value) | |
; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment