@@ -62,30 +62,30 @@ public function testUpdate()
6262 $ builder ->update (['point ' => new Point (1 , 3 )]);
6363 }
6464
65- // public function testUpdateLinestring()
66- // {
67- // $this->queryBuilder
68- // ->shouldReceive('raw')
69- // ->with("ST_GeogFromText('LINESTRING(0 0, 1 1, 2 2)')")
70- // ->andReturn(new Expression("ST_GeogFromText('LINESTRING(0 0, 1 1, 2 2)')"));
71- //
72- // $this->queryBuilder
73- // ->shouldReceive('update')
74- // ->andReturn(1);
75- //
76- // $linestring = new LineString([new Point(0, 0), new Point(1, 1), new Point(2, 2)]);
77- //
78- // $builder = Mockery::mock(Builder::class, [$this->queryBuilder])->makePartial();
79- // $builder->shouldAllowMockingProtectedMethods();
80- // $builder
81- // ->shouldReceive('addUpdatedAtColumn')
82- // ->andReturn(['linestring' => $linestring]);
83- //
84- // $builder
85- // ->shouldReceive('asWKT')->with($linestring)->once();
86- //
87- // $builder->update(['linestring' => $linestring]);
88- // }
65+ public function testUpdateLinestring ()
66+ {
67+ $ this ->queryBuilder
68+ ->shouldReceive ('raw ' )
69+ ->with ("ST_GeogFromText('LINESTRING(0 0, 1 1, 2 2)') " )
70+ ->andReturn (new Expression ("ST_GeogFromText('LINESTRING(0 0, 1 1, 2 2)') " ));
71+
72+ $ this ->queryBuilder
73+ ->shouldReceive ('update ' )
74+ ->andReturn (1 );
75+
76+ $ linestring = new LineString ([new Point (0 , 0 ), new Point (1 , 1 ), new Point (2 , 2 )]);
77+
78+ $ builder = Mockery::mock (Builder::class, [$ this ->queryBuilder ])->makePartial ();
79+ $ builder ->shouldAllowMockingProtectedMethods ();
80+ $ builder
81+ ->shouldReceive ('addUpdatedAtColumn ' )
82+ ->andReturn (['linestring ' => $ linestring ]);
83+
84+ $ builder
85+ ->shouldReceive ('asWKT ' )->with ($ linestring )->once ();
86+
87+ $ builder ->update (['linestring ' => $ linestring ]);
88+ }
8989}
9090
9191class TestBuilderModel extends Model
0 commit comments