@@ -27,12 +27,13 @@ protected function setUp(): void
27
27
28
28
public function testConstructors (): void
29
29
{
30
- $ point = Sfc::point (23 , 56 , 4326 );
30
+ // Using 3059 because in MySQL
31
+ // ST_X(ST_SRID(POINT(23, 56), 4326)) is 56, but that doesn't happen with the other SRIDs...
32
+ $ point = Sfc::point (23 , 56 , 3059 );
31
33
32
- $ this ->assertEquals (23 , (string ) $ point ->x ());
33
34
$ this ->assertEquals (23 , $ this ->selectVal ($ point ->x ()));
34
35
$ this ->assertEquals (56 , $ this ->selectVal ($ point ->y ()));
35
- $ this ->assertEquals (4326 , $ this ->selectVal ($ point ->srid ()));
36
+ $ this ->assertEquals (3059 , $ this ->selectVal ($ point ->srid ()));
36
37
}
37
38
38
39
/**
@@ -55,30 +56,30 @@ public function testComplexActions(): void
55
56
56
57
$ pointInside = Sfc::point (3 , 5 );
57
58
$ pointOutside = Sfc::point (10 , 10 );
58
- $ this ->assertTrue ( $ this ->selectVal (
59
+ $ this ->assertEquals ( 1 , $ this ->selectVal (
59
60
$ hull ->contains ($ pointInside )
60
61
));
61
- $ this ->assertTrue ( $ this ->selectVal (
62
+ $ this ->assertEquals ( 1 , $ this ->selectVal (
62
63
$ pointInside ->within ($ hull )
63
64
));
64
- $ this ->assertFalse ( $ this ->selectVal (
65
+ $ this ->assertEquals ( 0 , $ this ->selectVal (
65
66
$ hull ->contains ($ pointOutside )
66
67
));
67
- $ this ->assertFalse ( $ this ->selectVal (
68
+ $ this ->assertEquals ( 0 , $ this ->selectVal (
68
69
$ pointOutside ->within ($ hull )
69
70
));
70
71
71
72
$ line = Sfc::lineFromText ('LINESTRING(3 3,10 10) ' );
72
- $ this ->assertFalse ( $ this ->selectVal (
73
+ $ this ->assertEquals ( 0 , this ->selectVal (
73
74
$ hull ->contains ($ line )
74
75
));
75
- $ this ->assertFalse ( $ this ->selectVal (
76
+ $ this ->assertEquals ( 0 , $ this ->selectVal (
76
77
$ line ->within ($ hull )
77
78
));
78
- $ this ->assertTrue ( $ this ->selectVal (
79
+ $ this ->assertEquals ( 1 , $ this ->selectVal (
79
80
$ hull ->intersects ($ line )
80
81
));
81
- $ this ->assertTrue ( $ this ->selectVal (
82
+ $ this ->assertEquals ( 1 , $ this ->selectVal (
82
83
$ line ->intersects ($ hull )
83
84
));
84
85
}
0 commit comments