Skip to content

Commit

Permalink
Improve code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Jan 2, 2023
1 parent 9f3e908 commit 4810307
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 4 additions & 5 deletions tests/Provider/APIv1ProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace WBW\Library\Pappers\Tests\Provider;

use Exception;
use InvalidArgumentException;
use Throwable;
use WBW\Library\Pappers\Provider\APIv1Provider;
Expand Down Expand Up @@ -67,7 +66,7 @@ public function testDocumentTelechargement(): void {

$res = $obj->documentTelechargement($request);
$this->assertInstanceOf(DocumentTelechargementResponse::class, $res);
} catch (Exception $ex) {
} catch (Throwable $ex) {

$this->assertInstanceOf(ApiException::class, $ex);
}
Expand All @@ -91,7 +90,7 @@ public function testEntreprise(): void {

$res = $obj->entreprise($request);
$this->assertInstanceOf(EntrepriseResponse::class, $res);
} catch (Exception $ex) {
} catch (Throwable $ex) {

$this->assertInstanceOf(ApiException::class, $ex);
}
Expand All @@ -114,7 +113,7 @@ public function testEntrepriseWithoutApiToken(): void {
try {

$obj->entreprise($request);
} catch (Exception $ex) {
} catch (Throwable $ex) {

$this->assertInstanceOf(InvalidArgumentException::class, $ex);
$this->assertEquals('The mandatory parameter "api_token" is missing', $ex->getMessage());
Expand Down Expand Up @@ -151,7 +150,7 @@ public function testRecherche(): void {

$res = $obj->recherche($request);
$this->assertInstanceOf(RechercheResponse::class, $res);
} catch (Exception $ex) {
} catch (Throwable $ex) {

$this->assertInstanceOf(ApiException::class, $ex);
}
Expand Down
5 changes: 2 additions & 3 deletions tests/Provider/APIv2ProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace WBW\Library\Pappers\Tests\Provider;

use Exception;
use Throwable;
use WBW\Library\Pappers\Provider\APIv2Provider;
use WBW\Library\Pappers\Request\DocumentTelechargementRequest;
Expand Down Expand Up @@ -83,7 +82,7 @@ public function testDocumentTelechargement(): void {

$res->saveAs($filename);
$this->assertFileExists($filename);
} catch (Exception $ex) {
} catch (Throwable $ex) {

$this->assertInstanceOf(ApiException::class, $ex);
}
Expand All @@ -107,7 +106,7 @@ public function testEntreprise(): void {

$res = $obj->entreprise($request);
$this->assertInstanceOf(EntrepriseResponse::class, $res);
} catch (Exception $ex) {
} catch (Throwable $ex) {

$this->assertInstanceOf(ApiException::class, $ex);
}
Expand Down

0 comments on commit 4810307

Please sign in to comment.