Exemplo n.º 1
0
 public function validFileProvider()
 {
     $root = vfsStream::setup();
     $file2Kb = vfsStream::newFile('2kb.txt')->withContent(LargeFileContent::withKilobytes(2))->at($root);
     $file2Mb = vfsStream::newFile('2mb.txt')->withContent(LargeFileContent::withMegabytes(2))->at($root);
     return array(array($file2Kb->url(), '1kb', null, true), array($file2Kb->url(), '2kb', null, true), array($file2Kb->url(), null, '2kb', true), array($file2Kb->url(), null, '3kb', true), array($file2Kb->url(), '1kb', '3kb', true), array($file2Mb->url(), '1mb', null, true), array($file2Mb->url(), '2mb', null, true), array($file2Mb->url(), null, '2mb', true), array($file2Mb->url(), null, '3mb', true), array($file2Mb->url(), '1mb', '3mb', true), array($file2Kb->url(), '3kb', null, false), array($file2Kb->url(), null, '1kb', false), array($file2Kb->url(), '1kb', '1.5kb', false), array($file2Mb->url(), '2.5mb', null, false), array($file2Mb->url(), '3gb', null, false), array($file2Mb->url(), null, '1b', false), array($file2Mb->url(), '1pb', '3pb', false));
 }
Exemplo n.º 2
0
 public function setUp()
 {
     parent::setUp();
     $this->root = vfsStream::setup('root_dir', null, ['foo.txt' => 'foobar', 'bar.php' => '<?php echo "bar";']);
     vfsStream::newFile('large.txt')->withContent(LargeFileContent::withMegabytes(100))->at($this->root);
     app()['path.upload'] = vfsStream::url('root_dir') . '/upload';
     $this->uploadService = app()->make('transit.upload');
 }