Skip to content

Commit

Permalink
no skip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Jul 31, 2016
1 parent 6d44fa9 commit a7fd5be
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions tests/DriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,27 @@ public function testBinaryData()

public function testPOSTPayload()
{
if ($this->_isPHP53()) {
skip();
}

$uniq = uniqid();
$payload = json_encode(array('key' => $uniq));
$url = 'http://mockbin.org/request?key=value';

$result = $this->_getClient()->request($url, $payload, 'post', array(
'headers' => array(//'Content-Type'
)
));
if ($this->_isPHP53()) {
$url = 'http://httpbin.org/post?key=value';
$result = $this->_getClient()->request($url, $payload, 'post');
$body = $result->getJSON();

$body = $result->getJSON();
isSame('value', $body->find('args.key'));
isSame('', $body->find('form.' . $payload));
isSame($url, $body->find('url'));

} else {
$url = 'http://mockbin.org/request?key=value';
$result = $this->_getClient()->request($url, $payload, 'post');
$body = $result->getJSON();

isSame($payload, $body->find('postData.text'));
isSame('value', $body->find('queryString.key'));
isSame('POST', $body->find('method'));
isSame($payload, $body->find('postData.text'));
isSame('value', $body->find('queryString.key'));
isSame('POST', $body->find('method'));
}
}

public function testAllMethods()
Expand Down

0 comments on commit a7fd5be

Please sign in to comment.