Example #1
0
 public function testFindAll()
 {
     $data = (object) array('id' => 1, 'name' => 'test');
     $this->api->expects($this->once())->method('get')->with($this->equalTo('people/1/users'))->will($this->returnValue(array($data)));
     $this->assertEquals(array(new User($data, $this->api->usersForCompany(1))), $this->api->usersForCompany(1)->findAll());
 }
Example #2
0
 public function testFindAll()
 {
     $data = (object) array('id' => 1, 'name' => 'test');
     $this->api->expects($this->once())->method('get')->with($this->equalTo('projects/project_id/tasks'))->will($this->returnValue(array($data)));
     $this->assertEquals(array(new Task($data, $this->api->tasksForProject('project_id'))), $this->api->tasksForProject('project_id')->findAll());
 }
 public function testFindAll()
 {
     $data = (object) array('id' => 1, 'name' => 'test');
     $this->api->expects($this->once())->method('get')->with($this->equalTo('context/comments'))->will($this->returnValue(array($data)));
     $this->assertEquals(array(new Comment($data, $this->api->commentsForContext('context'))), $this->api->commentsForContext('context')->findAll());
 }
 public function testFindArchived()
 {
     $data = (object) array('id' => 1, 'name' => 'test');
     $this->api->expects($this->once())->method('get')->with($this->equalTo('projects/archive'))->will($this->returnValue(array($data)));
     $this->assertEquals(array(new Project($data, $this->api->projects())), $this->api->projects()->findArchived());
 }