diff --git a/tests/Unit/PostQueryBuilderTest.php b/tests/Unit/PostQueryBuilderTest.php index 46e2d68..c6e82f0 100644 --- a/tests/Unit/PostQueryBuilderTest.php +++ b/tests/Unit/PostQueryBuilderTest.php @@ -47,13 +47,17 @@ public function can_create_a_builder_from_static_functions() /** * @test - * @runInSeparateProcess */ public function throw_error_on_missing_static_function() { - $this->expectException(Throwable::class); - - Post::missingStaticFunction(); + $errorThrown = false; + try { + Post::missingStaticFunction(); + } catch (Throwable $th) { + $errorThrown = true; + } + + $this->assertTrue($errorThrown); } private function assertQueryBuilder($function, $params, $postType) diff --git a/tests/Unit/ScopedQueryBuilderTest.php b/tests/Unit/ScopedQueryBuilderTest.php index 012ce62..8103f65 100644 --- a/tests/Unit/ScopedQueryBuilderTest.php +++ b/tests/Unit/ScopedQueryBuilderTest.php @@ -4,6 +4,7 @@ use Illuminate\Support\Collection; use Mockery; +use PHPUnit\Framework\Exception; use PHPUnit\Framework\TestCase; use Rareloop\Lumberjack\Application; use Rareloop\Lumberjack\Contracts\QueryBuilder as QueryBuilderContract; @@ -111,14 +112,18 @@ public function can_pass_params_into_a_query_scope_on_post_object() /** * @test - * @runInSeparateProcess */ public function missing_query_scope_throws_an_error() { - $this->expectException(Throwable::class); - - $builder = new ScopedQueryBuilder(PostWithQueryScope::class); - $builder->nonExistentScope(); + $errorThrown = false; + try { + $builder = new ScopedQueryBuilder(PostWithQueryScope::class); + $builder->nonExistentScope(); + } catch (Throwable $th) { + $errorThrown = true; + } + + $this->assertTrue($errorThrown); } /** @test */