public function testRemovesDuplicates()
 {
     vfsStreamWrapper::register();
     $structure = array('src' => array('src' => array(), 'Foo' => array('src' => array(), 'Foo' => array(), 'Bar.php' => '<?php')));
     vfsStream::create($structure, VfsStream::setup('project'));
     $dir = VfsStream::url('project/src');
     $directory = new Directory($dir, $dir);
     $files = $directory->findAllPhpFilesRecursivly();
     $foundFiles = array();
     foreach ($files as $f => $file) {
         $foundFiles[] = $f;
     }
     $this->assertEquals(array('vfs://project/src/Foo/Bar.php'), $foundFiles);
 }
예제 #2
0
 function it_adds_multiple_files()
 {
     vfsStream::setup('root', null, array('1.js' => 'a', '2.js' => 'b'));
     $this->add(array(VfsStream::url('root/1.js'), VfsStream::url('root/2.js')));
     $this->shouldHaveCount(2);
 }
 public function setUp()
 {
     // Create web server document root
     $this->fileSystem = VfsStream::setup('doc_root', null, ['var' => ['www' => ['html' => ['public' => []]]]]);
     AutoVersion::setDocumentRoot(VfsStream::url('doc_root'));
 }