예제 #1
0
 /** @inheritDoc */
 public function getFiles($path = '')
 {
     $keys = $this->gaufrette->listKeys($this->getGaufrettePath($path));
     $files = new ArrayCollection($keys['keys']);
     return $files->map(function ($path) {
         return new File($this, $path);
     });
 }
예제 #2
0
 public function testIsMappable()
 {
     $collection = new ArrayCollection(array(0, 1, 2, 3, 4));
     $mapped = $collection->map(function ($number) {
         return $number * 2;
     });
     $this->assertTrue($mapped->contains(0));
     $this->assertTrue($mapped->contains(2));
     $this->assertTrue($mapped->contains(4));
     $this->assertTrue($mapped->contains(6));
     $this->assertTrue($mapped->contains(8));
     $this->assertEquals(5, count($mapped));
     $this->assertNotSame($mapped, $collection);
 }