You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/HasSpatialTest.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ public function it_generates_sql_query_for_selectDistanceTo_scope(): void
22
22
23
23
// Assert
24
24
$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(
26
26
ST_SRID($castedAttr, ?),
27
27
ST_SRID(Point(?, ?), ?)
28
28
) as distance from `addresses`",
@@ -45,7 +45,7 @@ public function it_generates_sql_query_for_withinDistanceTo_scope(): void
45
45
46
46
// 3. Assert
47
47
$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(
49
49
ST_SRID($castedAttr, ?),
50
50
ST_SRID(Point(?, ?), ?)
51
51
) <= ?",
@@ -69,15 +69,15 @@ public function it_generates_sql_query_for_orderByDistanceTo_scope(): void
69
69
70
70
// 3. Assert
71
71
$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(
73
73
ST_SRID($castedAttr, ?),
74
74
ST_SRID(Point(?, ?), ?)
75
75
) asc",
76
76
actual: $queryForAsc->toSql()
77
77
);
78
78
79
79
$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(
81
81
ST_SRID($castedAttr, ?),
82
82
ST_SRID(Point(?, ?), ?)
83
83
) desc",
@@ -97,7 +97,7 @@ public function it_generates_sql_query_for_location_casted_attributes(): void
97
97
98
98
// 2. Act & Assert
99
99
$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`",
0 commit comments