This commit is contained in:
@@ -15,9 +15,10 @@ class MultiDownloaderClientTest extends TestCase
|
||||
|
||||
private function testFiles()
|
||||
{
|
||||
return array_map(function ($url) {
|
||||
return new FileRequest($url);
|
||||
}, $this->testFiles);
|
||||
return array_map(function ($url, $i) {
|
||||
return (new FileRequest($url))
|
||||
->fileOptions(['name' => 'test' . $i . '.png']);
|
||||
}, $this->testFiles, array_keys($this->testFiles));
|
||||
}
|
||||
|
||||
public function testDownloadAsString()
|
||||
@@ -30,14 +31,14 @@ class MultiDownloaderClientTest extends TestCase
|
||||
|
||||
$md5 = md5($response);
|
||||
|
||||
$this->assertEquals('ea9726d2ecbe6b820899ba125bf0ae94', $md5);
|
||||
$this->assertEquals('7542c2c2a0750ab9e62d50bbe83d4c1f', $md5);
|
||||
}
|
||||
|
||||
public function testDownloadTo()
|
||||
{
|
||||
$client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test']);
|
||||
|
||||
$path = sys_get_temp_dir() . '/testDownloadTo.zip';
|
||||
$path = __DIR__ . '/testDownloadTo.zip';
|
||||
|
||||
$client->setFiles($this->testFiles());
|
||||
$client->downloadTo($path);
|
||||
@@ -45,7 +46,7 @@ class MultiDownloaderClientTest extends TestCase
|
||||
$md5 = md5_file($path);
|
||||
|
||||
$this->assertFileExists($path);
|
||||
$this->assertEquals('ea9726d2ecbe6b820899ba125bf0ae94', $md5);
|
||||
$this->assertEquals('7542c2c2a0750ab9e62d50bbe83d4c1f', $md5);
|
||||
}
|
||||
|
||||
public function testForm()
|
||||
|
||||
BIN
tests/testDownloadTo.zip
Normal file
BIN
tests/testDownloadTo.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user