Exemplo n.º 1
0
 public function testCreation()
 {
     $p = new Project($this->container);
     $s = new Swimlane($this->container);
     $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
     $this->assertEquals(1, $s->create(array('project_id' => 1, 'name' => 'Swimlane #1')));
     $swimlanes = $s->getSwimlanes(1);
     $this->assertNotEmpty($swimlanes);
     $this->assertEquals(2, count($swimlanes));
     $this->assertEquals('Default swimlane', $swimlanes[0]['name']);
     $this->assertEquals('Swimlane #1', $swimlanes[1]['name']);
     $this->assertEquals(1, $s->getIdByName(1, 'Swimlane #1'));
     $this->assertEquals(0, $s->getIdByName(2, 'Swimlane #2'));
     $this->assertEquals('Swimlane #1', $s->getNameById(1));
     $this->assertEquals('', $s->getNameById(23));
 }