public function test_can_authorize() { $this->routeable->authorize(true); $this->assertTrue($this->routeable->isAuthorized()); $this->routeable->authorize(false); $this->assertFalse($this->routeable->isAuthorized()); }
public function test_can_set_route() { $urlMock = m::mock('Illuminate\\Contracts\\Routing\\UrlGenerator'); $urlMock->shouldReceive('route')->andReturn('url'); $this->container->shouldReceive('make')->andReturn($urlMock); $this->routeable->route('route'); $this->assertEquals('url', $this->routeable->getUrl()); }
public function test_get_items_sorts_items_by_weight() { $item = new DefaultItem($this->container); $item->name('second item'); $item->weight(2); $this->itemable->addItem($item); $item = new DefaultItem($this->container); $this->itemable->addItem($item); $item->name('first item'); $item->weight(1); $this->assertCount(2, $this->itemable->getItems()); $this->assertEquals('first item', $this->itemable->getItems()->first()->getName()); }