From 3702d9485494c40bdaf11416e7204fdbc8f37947 Mon Sep 17 00:00:00 2001 From: webeweb Date: Mon, 6 Feb 2023 17:51:55 +0100 Subject: [PATCH] =?UTF-8?q?Add=20Document=20t=C3=A9l=C3=A9chargement=20res?= =?UTF-8?q?ponse=20unit=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DocumentTelechargementResponseTest.php | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tests/Response/DocumentTelechargementResponseTest.php diff --git a/tests/Response/DocumentTelechargementResponseTest.php b/tests/Response/DocumentTelechargementResponseTest.php new file mode 100644 index 0000000..d28e7a9 --- /dev/null +++ b/tests/Response/DocumentTelechargementResponseTest.php @@ -0,0 +1,58 @@ + + * @package WBW\Library\Pappers\Tests\Response + */ +class DocumentTelechargementResponseTest extends AbstractTestCase { + + /** + * Tests saveAs() + * + * @return void + * @throws Throwable Throws an exception if an error occurs. + */ + public function testSaveAs(): void { + + // Set a filename mock. + $filename = __DIR__ . "/../../var/cache/DocumentTelechargementResponse.pdf"; + if (true === file_exists($filename)) { + unlink($filename); + } + + $obj = new DocumentTelechargementResponse(); + + $obj->saveAs($filename); + $this->assertFileExists($filename); + } + + /** + * Tests __construct() + * + * @return void + */ + public function test__construct(): void { + + $obj = new DocumentTelechargementResponse(); + + $this->assertInstanceOf(AbstractResponse::class, $obj); + } +}