Ejemplo n.º 1
0
 public function testCalculatePositions()
 {
     $tp = new TaskPosition($this->container);
     $tc = new TaskCreation($this->container);
     $p = new Project($this->container);
     $this->assertEquals(1, $p->create(array('name' => 'Project #1')));
     $this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1)));
     $positions = $tp->calculatePositions(1, 1, 2, 1);
     $this->assertNotFalse($positions);
     $this->assertNotEmpty($positions);
     $this->assertEmpty($positions[1]);
     $this->assertEmpty($positions[3]);
     $this->assertEmpty($positions[4]);
     $this->assertEquals(array(1), $positions[2]);
 }