Skip to content

Commit

Permalink
Fix upstream dependent test failure (#1595)
Browse files Browse the repository at this point in the history
  • Loading branch information
KentarouTakeda authored Oct 17, 2024
1 parent d3965aa commit ec61b82
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/MethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,28 @@ public function testOutput()
public function testEloquentBuilderOutput()
{
$reflectionClass = new \ReflectionClass(Builder::class);
$reflectionMethod = $reflectionClass->getMethod('with');
$reflectionMethod = $reflectionClass->getMethod('upsert');

$method = new Method($reflectionMethod, 'Builder', $reflectionClass);

$output = <<<'DOC'
/**
* Set the relationships that should be eager loaded.
* Insert new records or update the existing ones.
*
* @param string|array $relations
* @param string|\Closure|null $callback
* @return \Illuminate\Database\Eloquent\Builder|static
* @param array $values
* @param array|string $uniqueBy
* @param array|null $update
* @return int
* @static
*/
DOC;
$this->assertSame($output, $method->getDocComment(''));
$this->assertSame('with', $method->getName());
$this->assertSame('upsert', $method->getName());
$this->assertSame('\\' . Builder::class, $method->getDeclaringClass());
$this->assertSame('$relations, $callback', $method->getParams(true));
$this->assertSame(['$relations', '$callback'], $method->getParams(false));
$this->assertSame('$relations, $callback = null', $method->getParamsWithDefault(true));
$this->assertSame(['$relations', '$callback = null'], $method->getParamsWithDefault(false));
$this->assertSame('$values, $uniqueBy, $update', $method->getParams(true));
$this->assertSame(['$values', '$uniqueBy', '$update'], $method->getParams(false));
$this->assertSame('$values, $uniqueBy, $update = null', $method->getParamsWithDefault(true));
$this->assertSame(['$values', '$uniqueBy', '$update = null'], $method->getParamsWithDefault(false));
$this->assertTrue($method->shouldReturn());
}

Expand Down

0 comments on commit ec61b82

Please sign in to comment.