Exemplo n.º 1
0
 /**
  * @test
  */
 public function findAllShouldReturnAnArrayOfFileInstancesIfFilesAreFound()
 {
     $upload = ROOT_TESTS . '/data/self-lussing-manatee.jpg';
     $this->filelib->getFileRepository()->upload($upload, $this->filelib->getFolderRepository()->createByUrl('arto-tenhunen'));
     $this->filelib->getFileRepository()->upload($upload, $this->filelib->getFolderRepository()->createByUrl('arto-tenhunen/on'));
     $this->filelib->getFileRepository()->upload($upload, $this->filelib->getFolderRepository()->createByUrl('arto-tenhunen/on/suurmies'));
     $files = $this->op->findAll();
     $this->assertCount(3, $files);
 }
 public function attachTo(FileLibrary $filelib)
 {
     $this->folderRepository = $filelib->getFolderRepository();
 }
Exemplo n.º 3
0
 /**
  * @test
  */
 public function folderRepositoryCanBeSet()
 {
     $repo = $this->prophesize('Xi\\Filelib\\Folder\\FolderRepositoryInterface')->reveal();
     $filelib = new FileLibrary($this->getMockedStorageAdapter(), $this->getMockedBackendAdapter());
     $filelib->setFolderRepository($repo);
     $this->assertSame($repo, $filelib->getFolderRepository());
 }
Exemplo n.º 4
0
 public function setUp()
 {
     $this->ed = $this->prophesize('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
     $this->filelib = $this->getFilelib(true);
     $this->op = $this->filelib->getFolderRepository();
 }