File tree Expand file tree Collapse file tree
src/Illuminate/Database/Eloquent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -405,7 +405,7 @@ public function newFromBuilder($attributes = array())
405405 * @param string $connection
406406 * @return \Illuminate\Database\Eloquent\Collection
407407 */
408- public static function hydrate (array $ items , $ connection = null )
408+ public static function hydrate (array $ items = array () , $ connection = null )
409409 {
410410 $ collection = with ($ instance = new static )->newCollection ();
411411
Original file line number Diff line number Diff line change @@ -69,7 +69,6 @@ public function testHydrateCreatesCollectionOfModels()
6969 public function testHydrateRawMakesRawQuery ()
7070 {
7171 $ collection = EloquentModelHydrateRawStub::hydrateRaw ('SELECT ? ' , array ('foo ' ));
72-
7372 $ this ->assertEquals ('hydrated ' , $ collection );
7473 }
7574
@@ -894,11 +893,11 @@ public function newQuery($excludeDeleted = true)
894893}
895894
896895class EloquentModelHydrateRawStub extends Illuminate \Database \Eloquent \Model {
897- public static function hydrate ( ) { return 'hydrated ' ; }
896+ public static function hydrate ( array $ items = array (), $ connection = null ) { return 'hydrated ' ; }
898897 public function getConnection ()
899898 {
900899 $ mock = m::mock ('Illuminate\Database\Connection ' );
901- $ mock ->shouldReceive ('select ' )->once ()->with ('SELECT ? ' , array ('foo ' ));
900+ $ mock ->shouldReceive ('select ' )->once ()->with ('SELECT ? ' , array ('foo ' ))-> andReturn ( array ()) ;
902901 return $ mock ;
903902 }
904903}
You can’t perform that action at this time.
0 commit comments