public function getLoginedInstance() { if (!$this->loginedInstance instanceof PixivAPI) { $api = new PixivAPI(); $api->login($this->username, $this->password); $this->loginedInstance = $api; } return $this->loginedInstance; }
public function testLatestWorks() { $api = new PixivAPI(); $result = $api->latest_works(); $illust = $result['response'][0]; $this->assertTrue(is_array($result)); $this->assertArrayHasKey('status', $result); $this->assertNotEmpty($illust['title']); $this->assertNotEmpty($illust['image_urls']['px_480mw']); }