fail('exception was not thrown'); } catch (Throwable $e) { $actualType = $e::class; if ($actualType !== $exceptionType) { $this->fail("exception was {$actualType}, but expected {$exceptionType}"); } $exception = $e; } return [$exception, $result]; } }