htmlForm
This commit is contained in:
@@ -8,6 +8,18 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
class MultiDownloaderClientTest extends TestCase
|
||||
{
|
||||
private $testFiles = [
|
||||
'https://s3.eu-central-1.wasabisys.com/dev-data-nwb/multi-downloader-sat/tests/img/watermarks/portrait.png',
|
||||
'https://s3.eu-central-1.wasabisys.com/dev-data-nwb/multi-downloader-sat/tests/img/watermarks/paysage.png'
|
||||
];
|
||||
|
||||
private function testFiles()
|
||||
{
|
||||
return array_map(function ($url) {
|
||||
return new FileRequest($url);
|
||||
}, $this->testFiles);
|
||||
}
|
||||
|
||||
public static function getProperty($object, $property)
|
||||
{
|
||||
$reflectedClass = new \ReflectionClass($object);
|
||||
@@ -21,12 +33,7 @@ class MultiDownloaderClientTest extends TestCase
|
||||
{
|
||||
$client = new MultiDownloaderClient();
|
||||
|
||||
$files = [
|
||||
new FileRequest('https://s3.eu-central-1.wasabisys.com/dev-data-nwb/multi-downloader-sat/tests/img/watermarks/portrait.png'),
|
||||
new FileRequest('https://s3.eu-central-1.wasabisys.com/dev-data-nwb/multi-downloader-sat/tests/img/watermarks/paysage.png')
|
||||
];
|
||||
|
||||
$response = $client->downloadAsString($files);
|
||||
$response = $client->downloadAsString($this->testFiles());
|
||||
|
||||
$md5 = md5($response);
|
||||
|
||||
@@ -37,14 +44,9 @@ class MultiDownloaderClientTest extends TestCase
|
||||
{
|
||||
$client = new MultiDownloaderClient();
|
||||
|
||||
$files = [
|
||||
new FileRequest('https://s3.eu-central-1.wasabisys.com/dev-data-nwb/multi-downloader-sat/tests/img/watermarks/portrait.png'),
|
||||
new FileRequest('https://s3.eu-central-1.wasabisys.com/dev-data-nwb/multi-downloader-sat/tests/img/watermarks/paysage.png')
|
||||
];
|
||||
|
||||
$path = sys_get_temp_dir() . '/testDownloadTo.zip';
|
||||
|
||||
$client->downloadTo($path, $files);
|
||||
$client->downloadTo($path, $this->testFiles());
|
||||
|
||||
$md5 = md5_file($path);
|
||||
|
||||
@@ -61,6 +63,11 @@ class MultiDownloaderClientTest extends TestCase
|
||||
$this->assertEquals('1234567890', $apiKey);
|
||||
}
|
||||
|
||||
public function testForm()
|
||||
{
|
||||
echo (new MultiDownloaderClient())->htmlForm($this->testFiles());
|
||||
}
|
||||
|
||||
public function testApiKeyParam()
|
||||
{
|
||||
$client = new MultiDownloaderClient([
|
||||
|
||||
Reference in New Issue
Block a user