diff --git a/tests/Unit/MixedTest.php b/tests/Unit/MixedTest.php index 6e16553..2870ed8 100644 --- a/tests/Unit/MixedTest.php +++ b/tests/Unit/MixedTest.php @@ -13,7 +13,8 @@ public function test_search_signature() { $searchable = new ReflectionClass(Searchable::class); $searchableParameters = $searchable->getMethod('search')->getParameters(); - $searchableDoc = $searchable->getMethod('search')->getDocComment(); + $searchableDoc = $this->stripStaticFromReturnType($searchable->getMethod('search')->getDocComment()); + $mixed = new ReflectionClass(MixedSearch::class); $mixedParameters = $mixed->getMethod('search')->getParameters(); $mixedDoc = $mixed->getMethod('search')->getDocComment(); @@ -21,4 +22,12 @@ public function test_search_signature() $this->assertEquals($searchableParameters, $mixedParameters); $this->assertEquals($searchableDoc, $mixedDoc); } + + /** + * Helper method to remove "static" from the @return line in the doc comment. + */ + private function stripStaticFromReturnType($doc) + { + return preg_replace('/@return\s+\\\\Laravel\\\\Scout\\\\Builder/', '@return \Laravel\Scout\Builder', $doc); + } }