Example #1
0
 public function testGetAll()
 {
     $c = new Comment($this->container);
     $tc = new TaskCreation($this->container);
     $p = new Project($this->container);
     $this->assertEquals(1, $p->create(array('name' => 'test1')));
     $this->assertEquals(1, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 3, 'owner_id' => 1)));
     $this->assertNotFalse($c->create(array('task_id' => 1, 'comment' => 'c1', 'user_id' => 1)));
     $this->assertNotFalse($c->create(array('task_id' => 1, 'comment' => 'c2', 'user_id' => 1)));
     $this->assertNotFalse($c->create(array('task_id' => 1, 'comment' => 'c3', 'user_id' => 1)));
     $comments = $c->getAll(1);
     $this->assertNotEmpty($comments);
     $this->assertEquals(3, count($comments));
     $this->assertEquals(1, $comments[0]['id']);
     $this->assertEquals(2, $comments[1]['id']);
     $this->assertEquals(3, $comments[2]['id']);
     $this->assertEquals(3, $c->count(1));
 }