Permalink
Browse files

make calls to gimme bar api v1; test silencing of fopen

  • Loading branch information...
funkatron committed Apr 11, 2012
1 parent 7a20112 commit 716fcc993d5afad01d6028a748689884713f9e88
Showing with 15 additions and 3 deletions.
  1. +1 −1 README.md
  2. +14 −2 tests/tests.php
View
@@ -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);
```
View
@@ -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();
@@ -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"
);

0 comments on commit 716fcc9

Please sign in to comment.