コード例 #1
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->outputFS = new Filesystem(new Local(dirname($this->testSrc)));
     // download test video if it's not available yet
     try {
         if (!$this->outputFS->has(basename($this->testSrc))) {
             $client = new Client();
             $response = $client->get($this->testSrcUrl, ['stream' => true]);
             $body = $response->getBody();
             $fh = fopen($this->testSrc, 'w');
             while (!$body->eof()) {
                 fwrite($fh, $body->read(4096));
             }
             fclose($fh);
         }
         $this->outputFS->assertPresent(basename($this->testSrc));
     } catch (\Exception $e) {
         $this->markTestSkipped('Failed downloading sample video file');
     }
 }