Skip to content

Commit 6d4e0a4

Browse files
committed
Doing todo tests
1 parent a649582 commit 6d4e0a4

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

tests/GeospatialTest.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,23 @@
4040

4141
it('finds locations within a defined polygon', function () {
4242

43-
$locations = Location::whereGeoBox('location', ['lon' => -0.1450383, 'lat' => 51.5069158], ['lon' => -0.1270247, 'lat' => 51.5013233])->get();
43+
$expectedLon = -0.1392173;
44+
$expectedLat = 51.5045037;
45+
$topLeft = ['lon' => $expectedLon - 0.0005, 'lat' => $expectedLat + 0.0005];
46+
$bottomRight = ['lon' => $expectedLon + 0.0005, 'lat' => $expectedLat - 0.0005];
47+
48+
$locations = Location::whereGeoBox(
49+
'point',
50+
$topLeft,
51+
$bottomRight,
52+
)->get();
4453

4554
expect($locations->count())->toBe(1);
4655

47-
$locations->get()->each(function ($item) {
48-
expect($item->name)->toBe('StJamesPalace');
56+
$locations->each(function ($item) {
57+
expect($item->name)->toBe('St. James\'s Palace');
4958
});
50-
})->todo('need to add more checks around geo bounding box');
59+
});
5160

5261
it('finds locations near a point within max distance', function () {
5362
$locations = Location::whereGeoDistance('point', '200m', ['lat' => 51.5049537, 'lon' => -0.1392173])->get();

tests/ModelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@
457457
});
458458

459459
expect($names)->toBe(['fork', 'spork', 'spoon']);
460-
})->todo();
460+
});
461461

462462
it('tests chunk across many items', function () {
463463
$users = [];

0 commit comments

Comments
 (0)