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 testPosts() { $posts = Accounts::findPosts("Jethro_E7"); $this->assertInstanceOf('StarCitizen\\Models\\Store', $posts); $this->assertTrue(count($posts) > 0); foreach ($posts as $post) { $this->assertInstanceOf('StarCitizen\\Models\\Post', $post); } }
/** * @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; }