From 4ec33a1e212309b444d50f463e0100bb0cc76dfb Mon Sep 17 00:00:00 2001 From: "Abdulmhsen B. A. A" Date: Fri, 18 Mar 2022 14:28:41 +0300 Subject: [PATCH] fixed thrown exception test. --- src/Libs/Storage/PDO/PDOAdapter.php | 2 +- tests/Storage/PDOAdapterTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Libs/Storage/PDO/PDOAdapter.php b/src/Libs/Storage/PDO/PDOAdapter.php index 212c4b1d..a44bf74c 100644 --- a/src/Libs/Storage/PDO/PDOAdapter.php +++ b/src/Libs/Storage/PDO/PDOAdapter.php @@ -63,7 +63,7 @@ final class PDOAdapter implements StorageInterface ) ); } catch (PDOException $e) { - throw new \PDOException(sprintf('Unable to connect to storage backend. \'%s\'.', $e->getMessage())); + throw new StorageException(sprintf('Unable to connect to storage backend. \'%s\'.', $e->getMessage())); } $driver = $this->getDriver(); diff --git a/tests/Storage/PDOAdapterTest.php b/tests/Storage/PDOAdapterTest.php index 970bfc84..8daec44b 100644 --- a/tests/Storage/PDOAdapterTest.php +++ b/tests/Storage/PDOAdapterTest.php @@ -48,7 +48,7 @@ class PDOAdapterTest extends TestCase public function test_setup_throw_exception_if_invalid_dsn(): void { - $this->expectException(PDOException::class); + $this->expectException(StorageException::class); $storage = new PDOAdapter(new CliLogger($this->output)); $storage->setUp(['dsn' => 'not_real_driver::foo']); }