/** * @test * * Test unauthenticated GET */ public function shouldGetPublicUserInfo() { $this->checkEnvVars(); $client = new \phpSmug\Client(getenv('APIKEY'), ['AppName' => 'phpSmug Unit Testing']); $response = $client->get('user/colinseymour'); $this->assertTrue(is_object($response)); $this->assertEquals('Public', $response->User->ResponseLevel); $this->assertEquals('colinseymour', $response->User->NickName); }
/** * @test */ public function shouldDeleteAlbum() { $mock = new MockHandler([new Response(200, [], $this->fauxDeleteResponse)]); $handler = HandlerStack::create($mock); $client = new Client($this->APIKey, ['handler' => $handler]); $response = $client->delete('album/rAnD0m'); $this->assertTrue(is_object($response)); $this->assertEquals('Album', $response->Locator); $this->assertEquals('/api/v2/album/rAnD0m', $response->Uri); }