From e8cf208f8c5c4cf4cf42df10a68f8a2e5f25aae5 Mon Sep 17 00:00:00 2001 From: George Boot Date: Fri, 4 Sep 2020 12:49:16 +0200 Subject: [PATCH 1/7] Laravel 8 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 8dfecb78..7acd9fe0 100644 --- a/composer.json +++ b/composer.json @@ -18,14 +18,14 @@ "php": ">=5.5.9", "ext-pdo": "*", "ext-json": "*", - "illuminate/database": "^5.2|^6.0|^7.0", + "illuminate/database": "^8.0", "geo-io/wkb-parser": "^1.0", "jmikola/geojson": "^1.0" }, "require-dev": { "phpunit/phpunit": "~4.8|~5.7", "mockery/mockery": "^0.9.9", - "laravel/laravel": "^5.2|^6.0|^7.0", + "laravel/laravel": "^8.0", "doctrine/dbal": "^2.5", "laravel/browser-kit-testing": "^2.0", "php-coveralls/php-coveralls": "^2.0" From 1e47ab8a78963e719f0d78ea73a60eeeda35caf7 Mon Sep 17 00:00:00 2001 From: George Boot Date: Fri, 4 Sep 2020 12:49:22 +0200 Subject: [PATCH 2/7] Make public --- src/Eloquent/BaseBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Eloquent/BaseBuilder.php b/src/Eloquent/BaseBuilder.php index 549e3f98..a2130840 100644 --- a/src/Eloquent/BaseBuilder.php +++ b/src/Eloquent/BaseBuilder.php @@ -6,7 +6,7 @@ class BaseBuilder extends QueryBuilder { - protected function cleanBindings(array $bindings) + public function cleanBindings(array $bindings) { $spatialBindings = []; foreach ($bindings as &$binding) { From 04e061526870a2d046eac9e31edee1ab0808f27e Mon Sep 17 00:00:00 2001 From: Joseph Estefane Date: Sun, 20 Sep 2020 20:40:01 -0400 Subject: [PATCH 3/7] Prep for Laravel 8 - Removed PHP versions prior to 7.3 - Upgraded mockery to ^1.3 and phpunit to ~6.5 - Using php-coveralls.phar instead of installing as dev dependency (fixes issue with Guzzle 6 vs 7) - Updated tests :lab_coat: :test_tube: - Updated README.md :book: --- .travis.yml | 10 +- README.md | 3 +- composer.json | 9 +- tests/Unit/BaseTestCase.php | 4 +- tests/Unit/Eloquent/BuilderTest.php | 42 ++-- tests/Unit/Eloquent/SpatialTraitTest.php | 8 +- tests/Unit/MysqlConnectionTest.php | 3 +- tests/Unit/Schema/BlueprintTest.php | 209 +++++++++++++++++--- tests/Unit/Types/GeometryCollectionTest.php | 5 +- tests/Unit/Types/LineStringTest.php | 5 +- tests/Unit/Types/MultiLineStringTest.php | 5 +- tests/Unit/Types/MultiPointTest.php | 5 +- tests/Unit/Types/MultiPolygonTest.php | 5 +- 13 files changed, 249 insertions(+), 64 deletions(-) diff --git a/.travis.yml b/.travis.yml index b5a50f0e..14c9d7f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,8 @@ language: php php: - - '5.5' - - '5.6' - - '7.0' - - '7.1' - - '7.2' - '7.3' + - '7.4' env: - MYSQL_VERSION=8.0 @@ -30,10 +26,12 @@ before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build + - curl -L https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar > ./php-coveralls.phar + - chmod +x php-coveralls.phar script: vendor/bin/phpunit --coverage-clover build/logs/clover.xml after_script: - - php vendor/bin/coveralls -v + - ./php-coveralls.phar -v - ./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT diff --git a/README.md b/README.md index 88c2a5ac..764b164a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ Please check the documentation for your MySQL version. MySQL's Extension for Spa - `1.x.x`: MySQL 5.6 (also supports MySQL 5.5 but not all spatial analysis functions) - `2.x.x`: MySQL 5.7 -- **`3.x.x`: MySQL 8.0 with SRID support (Current branch)** +- `3.x.x`: MySQL 8.0 with SRID support (Laravel version < 8.0) +- **`4.x.x`: MySQL 8.0 with SRID support (Laravel 8+) [Current branch]** This package also works with MariaDB. Please refer to the [MySQL/MariaDB Spatial Support Matrix](https://mariadb.com/kb/en/library/mysqlmariadb-spatial-support-matrix/) for compatibility. diff --git a/composer.json b/composer.json index 8dfecb78..53862a63 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=5.5.9", + "php": ">=7.3", "ext-pdo": "*", "ext-json": "*", "illuminate/database": "^5.2|^6.0|^7.0", @@ -23,12 +23,11 @@ "jmikola/geojson": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.7", - "mockery/mockery": "^0.9.9", + "phpunit/phpunit": "~6.5", "laravel/laravel": "^5.2|^6.0|^7.0", "doctrine/dbal": "^2.5", "laravel/browser-kit-testing": "^2.0", - "php-coveralls/php-coveralls": "^2.0" + "mockery/mockery": "^1.3" }, "autoload": { "psr-4": { @@ -43,7 +42,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0.x-dev" }, "laravel": { "providers": [ diff --git a/tests/Unit/BaseTestCase.php b/tests/Unit/BaseTestCase.php index 0b53a414..219f737d 100644 --- a/tests/Unit/BaseTestCase.php +++ b/tests/Unit/BaseTestCase.php @@ -1,6 +1,8 @@ queryBuilder ->shouldReceive('update') ->with(['point' => new SpatialExpression($point)]) - ->once(); + ->once() + ->andReturn(1); + + $result = $this->builder->update(['point' => $point]); - $this->builder->update(['point' => $point]); + $this->assertSame(1, $result); } public function testUpdateLinestring() @@ -53,9 +56,12 @@ public function testUpdateLinestring() $this->queryBuilder ->shouldReceive('update') ->with(['linestring' => new SpatialExpression($linestring)]) - ->once(); + ->once() + ->andReturn(1); - $this->builder->update(['linestring' => $linestring]); + $result = $this->builder->update(['linestring' => $linestring]); + + $this->assertSame(1, $result); } public function testUpdatePolygon() @@ -68,9 +74,12 @@ public function testUpdatePolygon() $this->queryBuilder ->shouldReceive('update') ->with(['polygon' => new SpatialExpression($polygon)]) - ->once(); + ->once() + ->andReturn(1); + + $result = $this->builder->update(['polygon' => $polygon]); - $this->builder->update(['polygon' => $polygon]); + $this->assertSame(1, $result); } public function testUpdatePointWithSrid() @@ -79,9 +88,12 @@ public function testUpdatePointWithSrid() $this->queryBuilder ->shouldReceive('update') ->with(['point' => new SpatialExpression($point)]) - ->once(); + ->once() + ->andReturn(1); + + $result = $this->builder->update(['point' => $point]); - $this->builder->update(['point' => $point]); + $this->assertSame(1, $result); } public function testUpdateLinestringWithSrid() @@ -91,9 +103,12 @@ public function testUpdateLinestringWithSrid() $this->queryBuilder ->shouldReceive('update') ->with(['linestring' => new SpatialExpression($linestring)]) - ->once(); + ->once() + ->andReturn(1); - $this->builder->update(['linestring' => $linestring]); + $result = $this->builder->update(['linestring' => $linestring]); + + $this->assertSame(1, $result); } public function testUpdatePolygonWithSrid() @@ -106,9 +121,12 @@ public function testUpdatePolygonWithSrid() $this->queryBuilder ->shouldReceive('update') ->with(['polygon' => new SpatialExpression($polygon)]) - ->once(); + ->once() + ->andReturn(1); + + $result = $this->builder->update(['polygon' => $polygon]); - $this->builder->update(['polygon' => $polygon]); + $this->assertSame(1, $result); } } diff --git a/tests/Unit/Eloquent/SpatialTraitTest.php b/tests/Unit/Eloquent/SpatialTraitTest.php index 785c78a7..dd7358fc 100644 --- a/tests/Unit/Eloquent/SpatialTraitTest.php +++ b/tests/Unit/Eloquent/SpatialTraitTest.php @@ -5,9 +5,12 @@ use Grimzy\LaravelMysqlSpatial\Types\Point; use Illuminate\Database\Eloquent\Model; use Mockery as m; +use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; class SpatialTraitTest extends BaseTestCase { + use MockeryPHPUnitIntegration; + /** * @var TestModel */ @@ -217,7 +220,10 @@ public function testSettingRawAttributes() public function testSpatialFieldsNotDefinedException() { $model = new TestNoSpatialModel(); - $this->setExpectedException(SpatialFieldsNotDefinedException::class); + $this->assertException( + SpatialFieldsNotDefinedException::class, + 'TestNoSpatialModel has to define $spatialFields' + ); $model->getSpatialFields(); } diff --git a/tests/Unit/MysqlConnectionTest.php b/tests/Unit/MysqlConnectionTest.php index c630d990..cae970a2 100644 --- a/tests/Unit/MysqlConnectionTest.php +++ b/tests/Unit/MysqlConnectionTest.php @@ -2,9 +2,10 @@ use Grimzy\LaravelMysqlSpatial\MysqlConnection; use Grimzy\LaravelMysqlSpatial\Schema\Builder; +use PHPUnit\Framework\TestCase; use Stubs\PDOStub; -class MysqlConnectionTest extends PHPUnit_Framework_TestCase +class MysqlConnectionTest extends TestCase { private $mysqlConnection; diff --git a/tests/Unit/Schema/BlueprintTest.php b/tests/Unit/Schema/BlueprintTest.php index 8ceda39b..03e41733 100644 --- a/tests/Unit/Schema/BlueprintTest.php +++ b/tests/Unit/Schema/BlueprintTest.php @@ -4,6 +4,7 @@ use BaseTestCase; use Grimzy\LaravelMysqlSpatial\Schema\Blueprint; +use Illuminate\Database\Schema\ColumnDefinition; use Mockery; class BlueprintTest extends BaseTestCase @@ -23,161 +24,305 @@ public function setUp() public function testGeometry() { + $expectedCol = new ColumnDefinition([ + 'type' => 'geometry', + 'name' => 'col', + 'srid' => null + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('geometry', 'col', ['srid' => null]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->geometry('col'); - $this->blueprint->geometry('col'); + $this->assertSame($expectedCol, $result); } public function testPoint() { + $expectedCol = new ColumnDefinition([ + 'type' => 'point', + 'name' => 'col', + 'srid' => null + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('point', 'col', ['srid' => null]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->point('col'); - $this->blueprint->point('col'); + $this->assertSame($expectedCol, $result); } public function testLinestring() { + $expectedCol = new ColumnDefinition([ + 'type' => 'linestring', + 'name' => 'col', + 'srid' => null + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('linestring', 'col', ['srid' => null]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->linestring('col'); - $this->blueprint->linestring('col'); + $this->assertSame($expectedCol, $result); } public function testPolygon() { + $expectedCol = new ColumnDefinition([ + 'type' => 'polygon', + 'name' => 'col', + 'srid' => null + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('polygon', 'col', ['srid' => null]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->polygon('col'); - $this->blueprint->polygon('col'); + $this->assertSame($expectedCol, $result); } public function testMultiPoint() { + $expectedCol = new ColumnDefinition([ + 'type' => 'multipoint', + 'name' => 'col', + 'srid' => null + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('multipoint', 'col', ['srid' => null]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->multipoint('col'); - $this->blueprint->multipoint('col'); + $this->assertSame($expectedCol, $result); } public function testMultiLineString() { + $expectedCol = new ColumnDefinition([ + 'type' => 'multilinestring', + 'name' => 'col', + 'srid' => null + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('multilinestring', 'col', ['srid' => null]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->multilinestring('col'); - $this->blueprint->multilinestring('col'); + $this->assertSame($expectedCol, $result); } public function testMultiPolygon() { + $expectedCol = new ColumnDefinition([ + 'type' => 'multipolygon', + 'name' => 'col', + 'srid' => null + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('multipolygon', 'col', ['srid' => null]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->multipolygon('col'); - $this->blueprint->multipolygon('col'); + $this->assertSame($expectedCol, $result); } public function testGeometryCollection() { + $expectedCol = new ColumnDefinition([ + 'type' => 'geometrycollection', + 'name' => 'col', + 'srid' => null + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('geometrycollection', 'col', ['srid' => null]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->geometrycollection('col'); - $this->blueprint->geometrycollection('col'); + $this->assertSame($expectedCol, $result); } public function testGeometryWithSrid() { + $expectedCol = new ColumnDefinition([ + 'type' => 'geometry', + 'name' => 'col', + 'srid' => 4326 + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('geometry', 'col', ['srid' => 4326]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->geometry('col', 4326); - $this->blueprint->geometry('col', 4326); + $this->assertSame($expectedCol, $result); } public function testPointWithSrid() { + $expectedCol = new ColumnDefinition([ + 'type' => 'point', + 'name' => 'col', + 'srid' => 4326 + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('point', 'col', ['srid' => 4326]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->point('col', 4326); - $this->blueprint->point('col', 4326); + $this->assertSame($expectedCol, $result); } public function testLinestringWithSrid() { + $expectedCol = new ColumnDefinition([ + 'type' => 'linestring', + 'name' => 'col', + 'srid' => 4326 + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('linestring', 'col', ['srid' => 4326]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->linestring('col', 4326); - $this->blueprint->linestring('col', 4326); + $this->assertSame($expectedCol, $result); } public function testPolygonWithSrid() { + $expectedCol = new ColumnDefinition([ + 'type' => 'polygon', + 'name' => 'col', + 'srid' => 4326 + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('polygon', 'col', ['srid' => 4326]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->polygon('col', 4326); - $this->blueprint->polygon('col', 4326); + $this->assertSame($expectedCol, $result); } public function testMultiPointWithSrid() { + $expectedCol = new ColumnDefinition([ + 'type' => 'multipoint', + 'name' => 'col', + 'srid' => 4326 + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('multipoint', 'col', ['srid' => 4326]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->multipoint('col', 4326); - $this->blueprint->multipoint('col', 4326); + $this->assertSame($expectedCol, $result); } public function testMultiLineStringWithSrid() { + $expectedCol = new ColumnDefinition([ + 'type' => 'multilinestring', + 'name' => 'col', + 'srid' => 4326 + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('multilinestring', 'col', ['srid' => 4326]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->multilinestring('col', 4326); - $this->blueprint->multilinestring('col', 4326); + $this->assertSame($expectedCol, $result); } public function testMultiPolygonWithSrid() { + $expectedCol = new ColumnDefinition([ + 'type' => 'multipolygon', + 'name' => 'col', + 'srid' => 4326 + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('multipolygon', 'col', ['srid' => 4326]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->multipolygon('col', 4326); - $this->blueprint->multipolygon('col', 4326); + $this->assertSame($expectedCol, $result); } public function testGeometryCollectionWithSrid() { + $expectedCol = new ColumnDefinition([ + 'type' => 'geometrycollection', + 'name' => 'col', + 'srid' => 4326 + ]); + $this->blueprint ->shouldReceive('addColumn') ->with('geometrycollection', 'col', ['srid' => 4326]) - ->once(); + ->once() + ->andReturn($expectedCol); + + $result = $this->blueprint->geometrycollection('col', 4326); - $this->blueprint->geometrycollection('col', 4326); + $this->assertSame($expectedCol, $result); } } diff --git a/tests/Unit/Types/GeometryCollectionTest.php b/tests/Unit/Types/GeometryCollectionTest.php index 4576a77b..a0d6f016 100644 --- a/tests/Unit/Types/GeometryCollectionTest.php +++ b/tests/Unit/Types/GeometryCollectionTest.php @@ -129,7 +129,10 @@ public function testFromJson() public function testInvalidGeoJsonException() { - $this->setExpectedException(\Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException::class); + $this->assertException( + \Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException::class, + sprintf('Expected %s, got %s', GeoJson\Feature\FeatureCollection::class, GeoJson\Geometry\Point::class) + ); GeometryCollection::fromJson('{"type":"Point","coordinates":[3.4,1.2]}'); } diff --git a/tests/Unit/Types/LineStringTest.php b/tests/Unit/Types/LineStringTest.php index 9300e3f1..ce5713d2 100644 --- a/tests/Unit/Types/LineStringTest.php +++ b/tests/Unit/Types/LineStringTest.php @@ -45,7 +45,10 @@ public function testFromJson() public function testInvalidGeoJsonException() { - $this->setExpectedException(\Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException::class); + $this->assertException( + \Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException::class, + sprintf('Expected %s, got %s', \GeoJson\Geometry\LineString::class, GeoJson\Geometry\Point::class) + ); LineString::fromJson('{"type":"Point","coordinates":[3.4,1.2]}'); } diff --git a/tests/Unit/Types/MultiLineStringTest.php b/tests/Unit/Types/MultiLineStringTest.php index 563ecbd1..16477feb 100644 --- a/tests/Unit/Types/MultiLineStringTest.php +++ b/tests/Unit/Types/MultiLineStringTest.php @@ -45,7 +45,10 @@ public function testFromJson() public function testInvalidGeoJsonException() { - $this->setExpectedException(\Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException::class); + $this->assertException( + \Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException::class, + sprintf('Expected %s, got %s', GeoJson\Geometry\MultiLineString::class, GeoJson\Geometry\Point::class) + ); MultiLineString::fromJson('{"type":"Point","coordinates":[3.4,1.2]}'); } diff --git a/tests/Unit/Types/MultiPointTest.php b/tests/Unit/Types/MultiPointTest.php index 6e94af87..a8a94f41 100644 --- a/tests/Unit/Types/MultiPointTest.php +++ b/tests/Unit/Types/MultiPointTest.php @@ -42,7 +42,10 @@ public function testFromJson() public function testInvalidGeoJsonException() { - $this->setExpectedException(\Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException::class); + $this->assertException( + \Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException::class, + sprintf('Expected %s, got %s', GeoJson\Geometry\MultiPoint::class, GeoJson\Geometry\Point::class) + ); MultiPoint::fromJson('{"type":"Point","coordinates":[3.4,1.2]}'); } diff --git a/tests/Unit/Types/MultiPolygonTest.php b/tests/Unit/Types/MultiPolygonTest.php index a37df382..3e49d32d 100644 --- a/tests/Unit/Types/MultiPolygonTest.php +++ b/tests/Unit/Types/MultiPolygonTest.php @@ -65,7 +65,10 @@ public function testFromJson() public function testInvalidGeoJsonException() { - $this->setExpectedException(\Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException::class); + $this->assertException( + \Grimzy\LaravelMysqlSpatial\Exceptions\InvalidGeoJsonException::class, + sprintf('Expected %s, got %s', GeoJson\Geometry\MultiPolygon::class, GeoJson\Geometry\Point::class) + ); MultiPolygon::fromJson('{"type":"Point","coordinates":[3.4,1.2]}'); } From 6cc29470bbcc0fc7cea494923fb766e4ce2d5956 Mon Sep 17 00:00:00 2001 From: Joseph Estefane Date: Mon, 21 Sep 2020 00:43:12 +0000 Subject: [PATCH 4/7] Apply fixes from StyleCI [ci skip] [skip ci] --- tests/Unit/Eloquent/SpatialTraitTest.php | 2 +- tests/Unit/Schema/BlueprintTest.php | 32 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/Unit/Eloquent/SpatialTraitTest.php b/tests/Unit/Eloquent/SpatialTraitTest.php index dd7358fc..8ece7d25 100644 --- a/tests/Unit/Eloquent/SpatialTraitTest.php +++ b/tests/Unit/Eloquent/SpatialTraitTest.php @@ -4,8 +4,8 @@ use Grimzy\LaravelMysqlSpatial\MysqlConnection; use Grimzy\LaravelMysqlSpatial\Types\Point; use Illuminate\Database\Eloquent\Model; -use Mockery as m; use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; +use Mockery as m; class SpatialTraitTest extends BaseTestCase { diff --git a/tests/Unit/Schema/BlueprintTest.php b/tests/Unit/Schema/BlueprintTest.php index 03e41733..c22c9518 100644 --- a/tests/Unit/Schema/BlueprintTest.php +++ b/tests/Unit/Schema/BlueprintTest.php @@ -27,7 +27,7 @@ public function testGeometry() $expectedCol = new ColumnDefinition([ 'type' => 'geometry', 'name' => 'col', - 'srid' => null + 'srid' => null, ]); $this->blueprint @@ -46,7 +46,7 @@ public function testPoint() $expectedCol = new ColumnDefinition([ 'type' => 'point', 'name' => 'col', - 'srid' => null + 'srid' => null, ]); $this->blueprint @@ -65,7 +65,7 @@ public function testLinestring() $expectedCol = new ColumnDefinition([ 'type' => 'linestring', 'name' => 'col', - 'srid' => null + 'srid' => null, ]); $this->blueprint @@ -84,7 +84,7 @@ public function testPolygon() $expectedCol = new ColumnDefinition([ 'type' => 'polygon', 'name' => 'col', - 'srid' => null + 'srid' => null, ]); $this->blueprint @@ -103,7 +103,7 @@ public function testMultiPoint() $expectedCol = new ColumnDefinition([ 'type' => 'multipoint', 'name' => 'col', - 'srid' => null + 'srid' => null, ]); $this->blueprint @@ -122,7 +122,7 @@ public function testMultiLineString() $expectedCol = new ColumnDefinition([ 'type' => 'multilinestring', 'name' => 'col', - 'srid' => null + 'srid' => null, ]); $this->blueprint @@ -141,7 +141,7 @@ public function testMultiPolygon() $expectedCol = new ColumnDefinition([ 'type' => 'multipolygon', 'name' => 'col', - 'srid' => null + 'srid' => null, ]); $this->blueprint @@ -160,7 +160,7 @@ public function testGeometryCollection() $expectedCol = new ColumnDefinition([ 'type' => 'geometrycollection', 'name' => 'col', - 'srid' => null + 'srid' => null, ]); $this->blueprint @@ -179,7 +179,7 @@ public function testGeometryWithSrid() $expectedCol = new ColumnDefinition([ 'type' => 'geometry', 'name' => 'col', - 'srid' => 4326 + 'srid' => 4326, ]); $this->blueprint @@ -198,7 +198,7 @@ public function testPointWithSrid() $expectedCol = new ColumnDefinition([ 'type' => 'point', 'name' => 'col', - 'srid' => 4326 + 'srid' => 4326, ]); $this->blueprint @@ -217,7 +217,7 @@ public function testLinestringWithSrid() $expectedCol = new ColumnDefinition([ 'type' => 'linestring', 'name' => 'col', - 'srid' => 4326 + 'srid' => 4326, ]); $this->blueprint @@ -236,7 +236,7 @@ public function testPolygonWithSrid() $expectedCol = new ColumnDefinition([ 'type' => 'polygon', 'name' => 'col', - 'srid' => 4326 + 'srid' => 4326, ]); $this->blueprint @@ -255,7 +255,7 @@ public function testMultiPointWithSrid() $expectedCol = new ColumnDefinition([ 'type' => 'multipoint', 'name' => 'col', - 'srid' => 4326 + 'srid' => 4326, ]); $this->blueprint @@ -274,7 +274,7 @@ public function testMultiLineStringWithSrid() $expectedCol = new ColumnDefinition([ 'type' => 'multilinestring', 'name' => 'col', - 'srid' => 4326 + 'srid' => 4326, ]); $this->blueprint @@ -293,7 +293,7 @@ public function testMultiPolygonWithSrid() $expectedCol = new ColumnDefinition([ 'type' => 'multipolygon', 'name' => 'col', - 'srid' => 4326 + 'srid' => 4326, ]); $this->blueprint @@ -312,7 +312,7 @@ public function testGeometryCollectionWithSrid() $expectedCol = new ColumnDefinition([ 'type' => 'geometrycollection', 'name' => 'col', - 'srid' => 4326 + 'srid' => 4326, ]); $this->blueprint From efb637e454332195c6c571ad915c29cc1dbc6256 Mon Sep 17 00:00:00 2001 From: Joseph Estefane Date: Sun, 20 Sep 2020 22:01:58 -0400 Subject: [PATCH 5/7] Remove coveralls --- .travis.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 14c9d7f6..f6a2a31f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,12 +26,8 @@ before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build - - curl -L https://github.com/php-coveralls/php-coveralls/releases/download/v2.2.0/php-coveralls.phar > ./php-coveralls.phar - - chmod +x php-coveralls.phar script: vendor/bin/phpunit --coverage-clover build/logs/clover.xml -after_script: - - ./php-coveralls.phar -v - - ./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT +after_script: ./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT From 2c4c67133925c0f33f6818b2b1eb66cabbc63ccb Mon Sep 17 00:00:00 2001 From: Joseph Estefane Date: Sun, 20 Sep 2020 22:19:55 -0400 Subject: [PATCH 6/7] Updated README.md :book: --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 764b164a..cab18d80 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,10 @@ This package also works with MariaDB. Please refer to the [MySQL/MariaDB Spatial Add the package using composer: ```sh -$ composer require grimzy/laravel-mysql-spatial +$ composer require grimzy/laravel-mysql-spatial:^4.0 + +# or for Laravel version < 8.0 +$ composer require grimzy/laravel-mysql-spatial:^3.0 ``` For MySQL 5.7: From 2ca9f2f25cf10e3b4771881108ecc9c69317bf57 Mon Sep 17 00:00:00 2001 From: Joseph Estefane Date: Sat, 17 Oct 2020 03:47:27 -0400 Subject: [PATCH 7/7] Update README.md :book: --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cab18d80..39d5303c 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,10 @@ Please check the documentation for your MySQL version. MySQL's Extension for Spa **Versions** - `1.x.x`: MySQL 5.6 (also supports MySQL 5.5 but not all spatial analysis functions) -- `2.x.x`: MySQL 5.7 +- `2.x.x`: MySQL 5.7 and 8.0 (Laravel version < 8.0) - `3.x.x`: MySQL 8.0 with SRID support (Laravel version < 8.0) - **`4.x.x`: MySQL 8.0 with SRID support (Laravel 8+) [Current branch]** +- `5.x.x`: MySQL 5.7 and 8.0 (Laravel 8+) This package also works with MariaDB. Please refer to the [MySQL/MariaDB Spatial Support Matrix](https://mariadb.com/kb/en/library/mysqlmariadb-spatial-support-matrix/) for compatibility.