diff --git a/src/Lunr/Corona/Exceptions/TemporarilyDisabledException.php b/src/Lunr/Corona/Exceptions/TemporarilyDisabledException.php new file mode 100644 index 00000000..46c8443c --- /dev/null +++ b/src/Lunr/Corona/Exceptions/TemporarilyDisabledException.php @@ -0,0 +1,34 @@ + diff --git a/src/Lunr/Corona/Exceptions/Tests/TemporarilyDisabledExceptionBaseTest.php b/src/Lunr/Corona/Exceptions/Tests/TemporarilyDisabledExceptionBaseTest.php new file mode 100644 index 00000000..fe7a2efd --- /dev/null +++ b/src/Lunr/Corona/Exceptions/Tests/TemporarilyDisabledExceptionBaseTest.php @@ -0,0 +1,48 @@ +assertPropertySame('code', 540); + } + + /** + * Test that the error code was set correctly. + */ + public function testApplicationErrorCodeSetCorrectly(): void + { + $this->assertPropertySame('app_code', $this->code); + } + + /** + * Test that the error message was passed correctly. + */ + public function testErrorMessagePassedCorrectly(): void + { + $this->expectExceptionMessage($this->message); + + throw $this->class; + } + +} + +?> diff --git a/src/Lunr/Corona/Exceptions/Tests/TemporarilyDisabledExceptionTest.php b/src/Lunr/Corona/Exceptions/Tests/TemporarilyDisabledExceptionTest.php new file mode 100644 index 00000000..e4d9ff10 --- /dev/null +++ b/src/Lunr/Corona/Exceptions/Tests/TemporarilyDisabledExceptionTest.php @@ -0,0 +1,79 @@ +message = 'Http error!'; + $this->code = 9999; + + $this->previous = new Exception(); + + $this->class = new TemporarilyDisabledException($this->message, $this->code, $this->previous); + + parent::baseSetUp($this->class); + } + + /** + * TestCase Destructor. + */ + public function tearDown(): void + { + unset($this->code); + unset($this->message); + unset($this->previous); + unset($this->class); + + parent::tearDown(); + } + +} + +?>