Skip to content

Commit bb9ded4

Browse files
committed
Testing for UnknownWKTTypeException. Replaced deprecated PhpUnit method.
1 parent 34d172c commit bb9ded4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests/Integration/SpatialTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function testSpatialFieldsNotDefinedException()
8787
$geo->geometry = new Point(1, 2);
8888
$geo->save();
8989

90-
$this->setExpectedException(\Grimzy\LaravelMysqlSpatial\Exceptions\SpatialFieldsNotDefinedException::class);
90+
$this->expectException(\Grimzy\LaravelMysqlSpatial\Exceptions\SpatialFieldsNotDefinedException::class);
9191
NoSpatialFieldsModel::all();
9292
}
9393

tests/Unit/Types/GeometryTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use Grimzy\LaravelMysqlSpatial\Exceptions\UnknownWKTTypeException;
34
use Grimzy\LaravelMysqlSpatial\Types\Geometry;
45
use Grimzy\LaravelMysqlSpatial\Types\GeometryCollection;
56
use Grimzy\LaravelMysqlSpatial\Types\LineString;
@@ -73,6 +74,8 @@ public function testGetWKTClass()
7374
GeometryCollection::class,
7475
Geometry::getWKTClass('GEOMETRYCOLLECTION(POINT(2 3),LINESTRING(2 3,3 4))')
7576
);
77+
$this->expectException(UnknownWKTTypeException::class);
78+
Geometry::getWKTClass('TRIANGLE((0 0, 0 9, 9 0, 0 0))');
7679
}
7780

7881
public function testGetWKBClass()

0 commit comments

Comments
 (0)