public function testUpdate() { $tl = new TaskLink($this->container); $p = new Project($this->container); $tc = new TaskCreation($this->container); $this->assertEquals(1, $p->create(array('name' => 'test1'))); $this->assertEquals(2, $p->create(array('name' => 'test2'))); $this->assertEquals(1, $tc->create(array('project_id' => 1, 'title' => 'A'))); $this->assertEquals(2, $tc->create(array('project_id' => 2, 'title' => 'B'))); $this->assertEquals(3, $tc->create(array('project_id' => 1, 'title' => 'C'))); $this->assertEquals(1, $tl->create(1, 2, 5)); $this->assertTrue($tl->update(1, 1, 3, 11)); $links = $tl->getAll(1); $this->assertNotEmpty($links); $this->assertCount(1, $links); $this->assertEquals('is fixed by', $links[0]['label']); $this->assertEquals('C', $links[0]['title']); $this->assertEquals(3, $links[0]['task_id']); $links = $tl->getAll(2); $this->assertEmpty($links); $links = $tl->getAll(3); $this->assertNotEmpty($links); $this->assertCount(1, $links); $this->assertEquals('fixes', $links[0]['label']); $this->assertEquals('A', $links[0]['title']); $this->assertEquals(1, $links[0]['task_id']); }