@@ -214,29 +214,6 @@ public function testScopeDistanceExcludingSelf()
214214 $ this ->assertContains ("st_distance(`point`, GeomFromText('POINT(2 1)')) != 0 " , $ q ->wheres [1 ]['sql ' ]);
215215 }
216216
217- public function testScopeDistanceSphere ()
218- {
219- $ point = new Point (1 , 2 );
220- $ query = TestModel::DistanceSphere (10 , $ point , 'point ' );
221-
222- $ this ->assertInstanceOf (\Grimzy \LaravelMysqlSpatial \Eloquent \Builder::class, $ query );
223- $ q = $ query ->getQuery ();
224- $ this ->assertNotEmpty ($ q ->wheres );
225- $ this ->assertContains ("st_distance_sphere(`point`, GeomFromText('POINT(2 1)')) <= 10 " , $ q ->wheres [0 ]['sql ' ]);
226- }
227-
228- public function testScopeDistanceSphereExcludingSelf ()
229- {
230- $ point = new Point (1 , 2 );
231- $ query = TestModel::DistanceSphere (10 , $ point , 'point ' , true );
232-
233- $ this ->assertInstanceOf (\Grimzy \LaravelMysqlSpatial \Eloquent \Builder::class, $ query );
234- $ q = $ query ->getQuery ();
235- $ this ->assertNotEmpty ($ q ->wheres );
236- $ this ->assertContains ("st_distance_sphere(`point`, GeomFromText('POINT(2 1)')) <= 10 " , $ q ->wheres [0 ]['sql ' ]);
237- $ this ->assertContains ("st_distance_sphere(`point`, GeomFromText('POINT(2 1)')) != 0 " , $ q ->wheres [1 ]['sql ' ]);
238- }
239-
240217 public function testScopeDistanceValue ()
241218 {
242219 $ point = new Point (1 , 2 );
@@ -263,32 +240,6 @@ public function testScopeDistanceValueWithSelect()
263240 $ this ->assertContains ("st_distance(`point`, GeomFromText('POINT(2 1)')) as distance " , $ q ->columns [1 ]->getValue ());
264241 }
265242
266- public function testScopeDistanceSphereValue ()
267- {
268- $ point = new Point (1 , 2 );
269- $ query = TestModel::DistanceSphereValue ($ point , 'point ' );
270-
271- $ this ->assertInstanceOf (\Grimzy \LaravelMysqlSpatial \Eloquent \Builder::class, $ query );
272- $ q = $ query ->getQuery ();
273- $ this ->assertNotEmpty ($ q ->columns );
274- $ this ->assertContains ("* " , $ q ->columns [0 ]);
275- $ this ->assertInstanceOf (\Illuminate \Database \Query \Expression::class, $ q ->columns [1 ]);
276- $ this ->assertContains ("st_distance_sphere(`point`, GeomFromText('POINT(2 1)')) as distance " , $ q ->columns [1 ]->getValue ());
277- }
278-
279- public function testScopeDistanceSphereValueWithSelect ()
280- {
281- $ point = new Point (1 , 2 );
282- $ query = TestModel::select ('some_column ' )->distanceSphereValue ($ point , 'point ' );
283-
284- $ this ->assertInstanceOf (\Grimzy \LaravelMysqlSpatial \Eloquent \Builder::class, $ query );
285- $ q = $ query ->getQuery ();
286- $ this ->assertNotEmpty ($ q ->columns );
287- $ this ->assertContains ("some_column " , $ q ->columns [0 ]);
288- $ this ->assertInstanceOf (\Illuminate \Database \Query \Expression::class, $ q ->columns [1 ]);
289- $ this ->assertContains ("st_distance_sphere(`point`, GeomFromText('POINT(2 1)')) as distance " , $ q ->columns [1 ]->getValue ());
290- }
291-
292243 private function buildTestPolygon (){
293244 $ point1 = new Point (1 , 1 );
294245 $ point2 = new Point (1 , 2 );
0 commit comments