Example #1
0
 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);
 }
Example #2
0
 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);
 }
Example #3
0
 /**
  * @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;
 }
Example #4
0
 /**
  * @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;
 }