@@ -59,27 +59,28 @@ public function testOutput()
5959 public function testEloquentBuilderOutput ()
6060 {
6161 $ reflectionClass = new \ReflectionClass (Builder::class);
62- $ reflectionMethod = $ reflectionClass ->getMethod ('with ' );
62+ $ reflectionMethod = $ reflectionClass ->getMethod ('upsert ' );
6363
6464 $ method = new Method ($ reflectionMethod , 'Builder ' , $ reflectionClass );
6565
6666 $ output = <<<'DOC'
6767/**
68- * Set the relationships that should be eager loaded .
68+ * Insert new records or update the existing ones .
6969 *
70- * @param string|array $relations
71- * @param string|\Closure|null $callback
72- * @return \Illuminate\Database\Eloquent\Builder|static
70+ * @param array $values
71+ * @param array|string $uniqueBy
72+ * @param array|null $update
73+ * @return int
7374 * @static
7475 */
7576DOC;
7677 $ this ->assertSame ($ output , $ method ->getDocComment ('' ));
77- $ this ->assertSame ('with ' , $ method ->getName ());
78+ $ this ->assertSame ('upsert ' , $ method ->getName ());
7879 $ this ->assertSame ('\\' . Builder::class, $ method ->getDeclaringClass ());
79- $ this ->assertSame ('$relations , $callback ' , $ method ->getParams (true ));
80- $ this ->assertSame (['$relations ' , '$callback ' ], $ method ->getParams (false ));
81- $ this ->assertSame ('$relations , $callback = null ' , $ method ->getParamsWithDefault (true ));
82- $ this ->assertSame (['$relations ' , '$callback = null ' ], $ method ->getParamsWithDefault (false ));
80+ $ this ->assertSame ('$values , $uniqueBy, $update ' , $ method ->getParams (true ));
81+ $ this ->assertSame (['$values ' , '$uniqueBy ' , ' $update ' ], $ method ->getParams (false ));
82+ $ this ->assertSame ('$values , $uniqueBy, $update = null ' , $ method ->getParamsWithDefault (true ));
83+ $ this ->assertSame (['$values ' , '$uniqueBy ' , ' $update = null ' ], $ method ->getParamsWithDefault (false ));
8384 $ this ->assertTrue ($ method ->shouldReturn ());
8485 }
8586
0 commit comments