public function testInstantiate() { $rawData = Accounts::findPosts("Jethro_E7", true, false); $store = new Store($rawData['data'], '\\Post', 'post', 'post_id'); $store->new = true; $this->assertFalse($store->new); }
public function testWith() { $account = Accounts::findProfile("jethro_e7")->with('posts', 'Threads', 'doesNotExist'); $this->assertInstanceOf('StarCitizen\\Models\\Store', $account->threads); $this->assertInstanceOf('StarCitizen\\Models\\Store', $account->posts); $this->assertEquals('jethro_e7', Accounts::findProfile("jethro_e7")->with('posts', 'threads')->handle); }
/** * @return Store */ protected final function posts() { if ($this->posts === null) { $posts = Accounts::findPosts($this->handle); if ($posts instanceof Store) { $this->posts = $posts; } } return $this->posts; }
/** * @return Profile */ protected final function profile() { if ($this->profile === null) { $profile = Accounts::findProfile($this->handle); if ($profile instanceof Profile) { $this->profile = $profile; } } return $this->profile; }