public function testAdd() { $trail = new Trail(); $crumb0 = new Crumb('homepage', '/'); $crumb1 = new Crumb('foo', '/foo'); $trail->add($crumb0); $this->assertEquals($trail, $crumb0->getTrail()); $trail[] = $crumb1; $this->assertEquals($trail, $crumb1->getTrail()); }
public function testIsLast() { $crumb = new Crumb('foo'); $trail = new Trail(); $this->assertFalse($crumb->isLast()); $trail->add($crumb); $this->assertTrue($crumb->isLast()); $crumb2 = new Crumb('bar'); $trail->add($crumb2); $this->assertFalse($crumb->isLast()); $this->assertTrue($crumb2->isLast()); }