Skip to content

Commit 999c065

Browse files
committed
HasSpatial tests updated.
1 parent 27c9a43 commit 999c065

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/HasSpatialTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function it_generates_sql_query_for_selectDistanceTo_scope(): void
2222

2323
// Assert
2424
$this->assertEquals(
25-
expected: "select *, CONCAT(ST_AsText(addresses.$castedAttr), ',', ST_SRID(addresses.$castedAttr)) as $castedAttr, ST_Distance(
25+
expected: "select *, CONCAT(ST_AsText(addresses.$castedAttr, 'axis-order=long-lat'), ',', ST_SRID(addresses.$castedAttr)) as $castedAttr, ST_Distance(
2626
ST_SRID($castedAttr, ?),
2727
ST_SRID(Point(?, ?), ?)
2828
) as distance from `addresses`",
@@ -45,7 +45,7 @@ public function it_generates_sql_query_for_withinDistanceTo_scope(): void
4545

4646
// 3. Assert
4747
$this->assertEquals(
48-
expected: "select *, CONCAT(ST_AsText(addresses.$castedAttr), ',', ST_SRID(addresses.$castedAttr)) as $castedAttr from `addresses` where ST_Distance(
48+
expected: "select *, CONCAT(ST_AsText(addresses.$castedAttr, 'axis-order=long-lat'), ',', ST_SRID(addresses.$castedAttr)) as $castedAttr from `addresses` where ST_Distance(
4949
ST_SRID($castedAttr, ?),
5050
ST_SRID(Point(?, ?), ?)
5151
) <= ?",
@@ -69,15 +69,15 @@ public function it_generates_sql_query_for_orderByDistanceTo_scope(): void
6969

7070
// 3. Assert
7171
$this->assertEquals(
72-
expected: "select *, CONCAT(ST_AsText(addresses.$castedAttr), ',', ST_SRID(addresses.$castedAttr)) as $castedAttr from `addresses` order by ST_Distance(
72+
expected: "select *, CONCAT(ST_AsText(addresses.$castedAttr, 'axis-order=long-lat'), ',', ST_SRID(addresses.$castedAttr)) as $castedAttr from `addresses` order by ST_Distance(
7373
ST_SRID($castedAttr, ?),
7474
ST_SRID(Point(?, ?), ?)
7575
) asc",
7676
actual: $queryForAsc->toSql()
7777
);
7878

7979
$this->assertEquals(
80-
expected: "select *, CONCAT(ST_AsText(addresses.$castedAttr), ',', ST_SRID(addresses.$castedAttr)) as $castedAttr from `addresses` order by ST_Distance(
80+
expected: "select *, CONCAT(ST_AsText(addresses.$castedAttr, 'axis-order=long-lat'), ',', ST_SRID(addresses.$castedAttr)) as $castedAttr from `addresses` order by ST_Distance(
8181
ST_SRID($castedAttr, ?),
8282
ST_SRID(Point(?, ?), ?)
8383
) desc",
@@ -97,7 +97,7 @@ public function it_generates_sql_query_for_location_casted_attributes(): void
9797

9898
// 2. Act & Assert
9999
$this->assertEquals(
100-
expected: "select *, CONCAT(ST_AsText(addresses.$castedAttr), ',', ST_SRID(addresses.$castedAttr)) as $castedAttr from `addresses`",
100+
expected: "select *, CONCAT(ST_AsText(addresses.$castedAttr, 'axis-order=long-lat'), ',', ST_SRID(addresses.$castedAttr)) as $castedAttr from `addresses`",
101101
actual: $address->query()->toSql()
102102
);
103103
}

0 commit comments

Comments
 (0)