Skip to content

Commit 1ac6c75

Browse files
committed
- Testing laravel 12 support
1 parent 467e482 commit 1ac6c75

File tree

5 files changed

+30
-22
lines changed

5 files changed

+30
-22
lines changed

.github/workflows/run-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,22 @@ jobs:
1616
fail-fast: true
1717
matrix:
1818
os: [ ubuntu-latest ]
19-
php: [ 8.3, 8.2, 8.1 ]
20-
laravel: [ 11.*, 10.* ]
19+
php: [ 8.4, 8.3, 8.2, 8.1 ]
20+
laravel: [ 12.*, 11.*, 10.* ]
2121
stability: [ prefer-lowest, prefer-stable ]
2222
include:
23+
- laravel: 12.*
24+
testbench: 10.*
25+
carbon: ^3.8.4
2326
- laravel: 11.*
2427
testbench: 9.*
2528
carbon: ^2.63
2629
- laravel: 10.*
2730
testbench: 8.*
2831
carbon: ^2.63
2932
exclude:
33+
- laravel: 12.*
34+
php: 8.1
3035
- laravel: 11.*
3136
php: 8.1
3237

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
],
1818
"require": {
1919
"php": "^8.1",
20-
"illuminate/support": "^10.0 || ^11.0",
20+
"illuminate/support": "^10.0 || ^11.0 || ^12.0",
2121
"matanyadaev/laravel-eloquent-spatial": "^4.4"
2222
},
2323
"require-dev": {
2424
"laravel/pint": "^1.14",
25-
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0",
26-
"phpunit/phpunit": "^9.5 || ^10.5"
25+
"orchestra/testbench": "^8.0 || ^9.0 || ^10.0",
26+
"phpunit/phpunit": "^10.5 || ^11.5.3"
2727
},
2828
"autoload": {
2929
"psr-4": {

tests/Feature/HasSpatialMySqlTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Javaabu\Geospatial\Tests\TestCase;
1010
use Javaabu\Geospatial\Tests\TestSupport\Models\City;
1111
use MatanYadaev\EloquentSpatial\Enums\Srid;
12+
use PHPUnit\Framework\Attributes\Test;
1213

1314
class HasSpatialMySqlTest extends TestCase
1415
{
@@ -24,7 +25,7 @@ public function setUp(): void
2425
parent::setUp();
2526
}
2627

27-
/** @test */
28+
#[Test]
2829
public function it_can_search_within_a_polygon_for_mysql(): void
2930
{
3031
$city = new City();
@@ -40,7 +41,7 @@ public function it_can_search_within_a_polygon_for_mysql(): void
4041
$this->assertNull(City::withinBounds($in_uligan)->first());
4142
}
4243

43-
/** @test */
44+
#[Test]
4445
public function it_can_set_polygon_for_mysql(): void
4546
{
4647
$city = new City();
@@ -56,7 +57,7 @@ public function it_can_set_polygon_for_mysql(): void
5657
]);
5758
}
5859

59-
/** @test */
60+
#[Test]
6061
public function it_can_get_polygon_for_mysql(): void
6162
{
6263
$city = new City();
@@ -70,7 +71,7 @@ public function it_can_get_polygon_for_mysql(): void
7071
$this->assertEquals($wkt, $city->boundary->toWkt());
7172
}
7273

73-
/** @test */
74+
#[Test]
7475
public function it_can_set_coordinates_for_mysql(): void
7576
{
7677
$city = new City();
@@ -87,7 +88,7 @@ public function it_can_set_coordinates_for_mysql(): void
8788
]);
8889
}
8990

90-
/** @test */
91+
#[Test]
9192
public function it_can_get_coordinates_for_mysql(): void
9293
{
9394
$city = new City();
@@ -103,7 +104,7 @@ public function it_can_get_coordinates_for_mysql(): void
103104
$this->assertEquals($latitude, $city->lat);
104105
}
105106

106-
/** @test */
107+
#[Test]
107108
public function it_generates_lat_from_the_default_point_column(): void
108109
{
109110
$city = new City();
@@ -117,7 +118,7 @@ public function it_generates_lat_from_the_default_point_column(): void
117118
$this->assertEquals($latitude, $city->lat);
118119
}
119120

120-
/** @test */
121+
#[Test]
121122
public function it_generates_lng_from_the_default_point_column(): void
122123
{
123124
$city = new City();

tests/Feature/HasSpatialSqliteTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Javaabu\Geospatial\Tests\TestCase;
1010
use Javaabu\Geospatial\Tests\TestSupport\Models\City;
1111
use MatanYadaev\EloquentSpatial\Enums\Srid;
12+
use PHPUnit\Framework\Attributes\Test;
1213

1314
class HasSpatialSqliteTest extends TestCase
1415
{
@@ -24,7 +25,7 @@ public function setUp(): void
2425
parent::setUp();
2526
}
2627

27-
/** @test */
28+
#[Test]
2829
public function it_can_set_polygon_for_sqlite(): void
2930
{
3031
$city = new City();
@@ -40,7 +41,7 @@ public function it_can_set_polygon_for_sqlite(): void
4041
]);
4142
}
4243

43-
/** @test */
44+
#[Test]
4445
public function it_can_get_polygon_for_sqlite(): void
4546
{
4647
$city = new City();
@@ -54,7 +55,7 @@ public function it_can_get_polygon_for_sqlite(): void
5455
$this->assertEquals($wkt, $city->boundary->toWkt());
5556
}
5657

57-
/** @test */
58+
#[Test]
5859
public function it_can_set_coordinates_for_sqlite(): void
5960
{
6061
$city = new City();
@@ -71,7 +72,7 @@ public function it_can_set_coordinates_for_sqlite(): void
7172
]);
7273
}
7374

74-
/** @test */
75+
#[Test]
7576
public function it_can_get_coordinates_for_sqlite(): void
7677
{
7778
$city = new City();

tests/Feature/ValidationRulesTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
use Javaabu\Geospatial\Tests\TestCase;
1010
use Javaabu\Geospatial\Tests\TestSupport\Models\City;
1111
use MatanYadaev\EloquentSpatial\Enums\Srid;
12+
use PHPUnit\Framework\Attributes\Test;
1213

1314
class ValidationRulesTest extends TestCase
1415
{
1516

16-
/** @test */
17+
#[Test]
1718
public function it_can_validate_wkt_geo_polygon(): void
1819
{
1920
$wkt = 'POLYGON((73.5092 4.1758, 73.5094 4.1758, 73.5094 4.1757, 73.5092 4.1757, 73.5092 4.1758))';
@@ -22,7 +23,7 @@ public function it_can_validate_wkt_geo_polygon(): void
2223
$this->assertFalse($validator->fails());
2324
}
2425

25-
/** @test */
26+
#[Test]
2627
public function it_can_validate_wkt_geo_polygon_without_polygon_prefix(): void
2728
{
2829
$wkt = '(73.5092 4.1758, 73.5094 4.1758, 73.5094 4.1757, 73.5092 4.1757, 73.5092 4.1758)';
@@ -31,7 +32,7 @@ public function it_can_validate_wkt_geo_polygon_without_polygon_prefix(): void
3132
$this->assertFalse($validator->fails());
3233
}
3334

34-
/** @test */
35+
#[Test]
3536
public function it_checks_if_start_and_end_values_are_same(): void
3637
{
3738
$wkt = 'POLYGON((73.5092 4.1758, 73.5094 4.1758, 73.5094 4.1757, 73.5092 4.1757, 73.5032 4.1718))';
@@ -40,7 +41,7 @@ public function it_checks_if_start_and_end_values_are_same(): void
4041
$this->assertTrue($validator->fails());
4142
}
4243

43-
/** @test */
44+
#[Test]
4445
public function it_checks_if_the_polygon_has_more_than_two_points(): void
4546
{
4647
$wkt = 'POLYGON((73.5092 4.1758, 73.5092 4.1758))';
@@ -49,7 +50,7 @@ public function it_checks_if_the_polygon_has_more_than_two_points(): void
4950
$this->assertTrue($validator->fails());
5051
}
5152

52-
/** @test */
53+
#[Test]
5354
public function it_does_not_accept_invalid_point_values(): void
5455
{
5556
$wkt = 'POLYGON((73.5092 4.1758, 73.5094 a4.1758, 73.5094 4.1757, 73.5092 4.1757, 73.5092 4.1758))';
@@ -58,7 +59,7 @@ public function it_does_not_accept_invalid_point_values(): void
5859
$this->assertTrue($validator->fails());
5960
}
6061

61-
/** @test */
62+
#[Test]
6263
public function it_does_not_accept_invalid_coordinate_values(): void
6364
{
6465
$wkt = 'POLYGON((73.5092 4.1758, 73.5094 14324.1758, 73.5094 4.1757, 73.5092 4.1757, 73.5092 4.1758))';

0 commit comments

Comments
 (0)