Skip to content

Commit

Permalink
make calls to gimme bar api v1; test silencing of fopen
Browse files Browse the repository at this point in the history
  • Loading branch information
funkatron committed Apr 11, 2012
1 parent 7a20112 commit 716fcc9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require __DIR__."/Resty.php";

$resty = new Resty();
$resty->debug(true);
$resty->setBaseURL('https://gimmebar.com/api/v0/');
$resty->setBaseURL('https://gimmebar.com/api/v1/');
$resp = $resty->get('public/assets/funkatron');
print_r($resp);
```
16 changes: 14 additions & 2 deletions tests/tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,22 @@
});


fu::test('Silence fopen test', function() {

$r = fu::fixture('resty');
try {
$r->get('http://fai9rp9whqrp9b8hqp98bhpwohropsrihbpohtpowhi/');
} catch(Exception $e) {
fu::equal('Stream open failed', $e->getMessage(), "Exception thrown and has correct message");
}

});


fu::test('gimme bar requests and responses', function() {

$r = fu::fixture('resty');
$r->setBaseURL('https://gimmebar.com/api/v0/');
$r->setBaseURL('https://gimmebar.com/api/v1/');
$resp = $r->get('public/assets/funkatron');
$req = $r->getLastRequest();

Expand All @@ -38,7 +50,7 @@

fu::equal(
$req['url'],
'https://gimmebar.com/api/v0/public/assets/funkatron',
'https://gimmebar.com/api/v1/public/assets/funkatron',
"URL was correct"
);

Expand Down

0 comments on commit 716fcc9

Please sign in to comment.