Skip to content

Commit

Permalink
Merge pull request #287 from matchish/hotfix-test
Browse files Browse the repository at this point in the history
Hotfix test
  • Loading branch information
matchish authored Oct 10, 2024
2 parents 996e161 + 329d843 commit a1be537
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 a1be537

Please sign in to comment.