diff --git a/src/TestProcessor.php b/src/TestProcessor.php index eb31a9a..b12819c 100644 --- a/src/TestProcessor.php +++ b/src/TestProcessor.php @@ -73,9 +73,9 @@ public function stop() : void { if (TestMemory::$currentTest !== null) { global $lastExceptionError, $lastError; $error = $lastExceptionError ?? $lastError; - if($error === null){ + if ($error === null) { TestResults::fatalTest(TestMemory::$currentTest, new ServerCrashedException()); - }else{ + } else { TestResults::fatalTest(TestMemory::$currentTest, ServerCrashedException::fromArray($error)); } $this->finish(false); diff --git a/src/utils/TimeoutException.php b/src/utils/TimeoutException.php index 44e8f47..8a711e5 100644 --- a/src/utils/TimeoutException.php +++ b/src/utils/TimeoutException.php @@ -5,4 +5,4 @@ use RuntimeException; class TimeoutException extends RuntimeException { -} \ No newline at end of file +} diff --git a/tests/pmmpunit/suitetest/normal/tests/TimeoutTest.php b/tests/pmmpunit/suitetest/normal/tests/TimeoutTest.php index 49b61d5..72a6a20 100644 --- a/tests/pmmpunit/suitetest/normal/tests/TimeoutTest.php +++ b/tests/pmmpunit/suitetest/normal/tests/TimeoutTest.php @@ -2,6 +2,7 @@ namespace ShockedPlot7560\PmmpUnit\tests\normal; +use Exception; use React\Promise\PromiseInterface; use ShockedPlot7560\PmmpUnit\framework\attribute\ExpectedExceptionAttribute; use ShockedPlot7560\PmmpUnit\framework\TestCase; @@ -12,15 +13,15 @@ class TimeoutTest extends TestCase { /** * @return PromiseInterface */ - #[ExpectedExceptionAttribute(TimeoutException::class)] + #[ExpectedExceptionAttribute(TimeoutException::class)] public function testTimeout() : PromiseInterface { - return $this->getPlayer()->then(function (TestPlayer $testPlayer) { - $promise = $this->promisePlayerReceiveMessageEquals("an_unique_string", $testPlayer, timeout: 5); + return $this->getPlayer()->then(function (TestPlayer $testPlayer) { + $promise = $this->promisePlayerReceiveMessageEquals("an_unique_string", $testPlayer, timeout: 5); - return $promise; - }) - ->then(function () { - throw new \Exception("This should not be called"); - }); + return $promise; + }) + ->then(function () { + throw new Exception("This should not be called"); + }); } }