getFileOptions()->name('test' . $i . '.png'); $watermark = new Watermark([ new WatermarkOption('https://dev-data-nwb.s3.eu-central-1.wasabisys.com/multi-downloader-sat/tests/img/watermarks/watermark.png', 100, 100) ]); $file->getImageEditOptions()->addWatermark($watermark); return $file; }, $this->testFiles, array_keys($this->testFiles)); } public function testDownloadAsString() { $client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test']); $client->setFiles($this->testFiles()); $response = $client->downloadAsString(); $md5 = md5($response); $this->assertEquals('65b11e1e8b2283f769006cec577ee8e0', $md5); } public function testDownloadTo() { $client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test']); $path = sys_get_temp_dir() . '/testDownloadTo.zip'; $client->setFiles($this->testFiles()); $client->downloadTo($path); $md5 = md5_file($path); $this->assertFileExists($path); $this->assertEquals('65b11e1e8b2283f769006cec577ee8e0', $md5); } public function testForm() { $client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test']); $client->setFiles($this->testFiles()); // echo $client->htmlForm(); $this->assertTrue(true); } public function testFormDlZipNameSpecified() { $client = new MultiDownloaderClient(['apiKey' => 'test', 'apiSecret' => 'test']); $client->setFiles($this->testFiles()); $output = $client->htmlForm("test123"); $this->assertStringContainsString('action="https://multi-dl.kub.nwb.fr/v2/form/zip/test123.zip"', $output); } }