Example #1
0
 /** @test */
 public function itShouldBeAbleToAddFilePaths()
 {
     $collection = new Collection();
     $collection->addFileResource(__FILE__);
     $res = $collection->all();
     $this->assertArrayHasKey(0, $res);
     $this->assertInstanceOf('Lucid\\Resource\\FileResource', $res[0]);
 }
Example #2
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;
 }