/** @test */ public function itShouldBeAbleToAddObjectResources() { $collection = new Collection(); $collection->addObjectResource($this); $res = $collection->all(); $this->assertArrayHasKey(0, $res); $this->assertInstanceOf('Lucid\\Resource\\ObjectResource', $res[0]); }
private function mockLocator() { $locator = $this->getMockbuilder('Lucid\\Resource\\LocatorInterface')->disableOriginalConstructor()->getMock(); $locator->method('locate')->willReturnCallback(function ($file) { $collection = new Collection(); if (file_exists($file = $this->fixure($file))) { $collection->addFileResource($file); } return $collection; }); return $locator; }