Наследование: extends AbstractAdapter, implements FOF30\Download\DownloadInterface
Пример #1
0
 /**
  * @covers  FOF30\Download\Adapter\Fopen::downloadAndReturn
  *
  * @dataProvider    FOF30\Tests\Download\Adapter\FopenDataprovider::getTestDownloadAndReturn
  *
  * @param array $config
  * @param array $test
  */
 public function testDownloadAndReturn(array $config, array $test)
 {
     FakeFopen::setUp($config);
     $adapter = new Fopen();
     if ($test['exception'] !== false) {
         $this->setExpectedException($test['exception']['name'], $test['exception']['message'], $test['exception']['code']);
     }
     $ret = $adapter->downloadAndReturn($test['url'], $test['from'], $test['to']);
     $retSize = 0;
     if (is_string($ret)) {
         $retSize = strlen($ret);
     }
     $this->assertEquals($test['retSize'], $retSize, $test['message']);
 }