Skip to content

Commit

Permalink
Merge branch 'matchish:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
swayok authored Oct 10, 2024
2 parents 96daaec + a1be537 commit d3d5c6f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/Unit/MixedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,21 @@ 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();

$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<static>/', '@return \Laravel\Scout\Builder', $doc);
}
}

0 comments on commit d3d5c6f

Please sign in to comment.