Skip to content

Commit

Permalink
Add Document téléchargement response unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Feb 6, 2023
1 parent eb7b1ec commit 3702d94
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions tests/Response/DocumentTelechargementResponseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

/*
* This file is part of the pappers-library package.
*
* (c) 2023 WEBEWEB
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace WBW\Library\Pappers\Tests\Response;

use Throwable;
use WBW\Library\Pappers\Response\AbstractResponse;
use WBW\Library\Pappers\Response\DocumentTelechargementResponse;
use WBW\Library\Pappers\Tests\AbstractTestCase;

/**
* Document téléchargement response test.
*
* @author webeweb <https://github.com/webeweb>
* @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);
}
}

0 comments on commit 3702d94

Please sign in to comment.