Skip to content

Commit 07bbefe

Browse files
committed
Merge branch 'release/2.8.0'
2 parents 738da01 + 3e9bdf7 commit 07bbefe

File tree

5 files changed

+166
-48
lines changed

5 files changed

+166
-48
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.0
1+
2.8.0

phpunit.xml.dist

Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,39 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<!--
4-
This is the "dist(ribution)" phpunit.xml.dist file. It sets the defaults that are then over written by any files in
5-
phpunit.xml, which is then over wrote by flags passed in via the command line. The plan is that this file is to be
6-
used by ci to do the full suit of tests, and a developer can copy this file to phpunit.xml to trim down some of the
7-
options.
8-
-->
9-
10-
<phpunit backupGlobals="false"
11-
backupStaticAttributes="false"
12-
bootstrap="vendor/autoload.php"
13-
colors="true"
14-
convertErrorsToExceptions="true"
15-
convertNoticesToExceptions="true"
16-
convertWarningsToExceptions="true"
17-
processIsolation="true"
18-
stopOnFailure="false"
19-
verbose="true">
20-
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
backupGlobals="false"
5+
backupStaticAttributes="false"
6+
bootstrap="vendor/autoload.php"
7+
colors="true"
8+
convertErrorsToExceptions="true"
9+
convertNoticesToExceptions="true"
10+
convertWarningsToExceptions="true"
11+
processIsolation="true"
12+
stopOnFailure="false"
13+
verbose="true"
14+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
15+
<coverage>
16+
<include>
17+
<directory suffix=".php">src/</directory>
18+
</include>
19+
<exclude>
20+
<directory suffix=".php">src/config</directory>
21+
</exclude>
22+
<report>
23+
<clover outputFile="build/phpunit/logs/clover.xml"/>
24+
<html outputDirectory="./build/phpunit/coverage" lowUpperBound="35" highLowerBound="70"/>
25+
<text outputFile="php://stdout" showUncoveredFiles="false" showOnlySummary="true"/>
26+
</report>
27+
</coverage>
2128
<testsuites>
2229
<testsuite name="Library Test Suite">
2330
<directory>./tests/</directory>
2431
</testsuite>
2532
</testsuites>
26-
2733
<php>
2834
<!-- <env name="VARIABLE" value="value"/> -->
2935
</php>
30-
31-
<filter>
32-
<whitelist>
33-
<directory suffix=".php">src/</directory>
34-
<exclude>
35-
<!--<file>src/file.php</file>-->
36-
<directory suffix=".php">src/config</directory>
37-
</exclude>
38-
</whitelist>
39-
</filter>
40-
4136
<logging>
42-
<log type="coverage-html"
43-
target="./build/phpunit/coverage"
44-
lowUpperBound="35"
45-
highLowerBound="70"/>
46-
<log type="coverage-text"
47-
target="php://stdout"
48-
showOnlySummary="true"
49-
showUncoveredFiles="false"/>
50-
<log type="coverage-clover" target="build/phpunit/logs/clover.xml"/>
51-
<log type="junit" target="./build/phpunit/logs/junit.xml"/>
37+
<junit outputFile="./build/phpunit/logs/junit.xml"/>
5238
</logging>
5339
</phpunit>

src/Geometry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ public function parse(object|string $data, ?string $type = null): GeometryProxy
126126
// If running in Laravel, then use the IoC
127127
return is_null($this->app)
128128
? new $geometry_class($geometry, $this->mapper)
129-
: $this->app->make($geometry_class, [$geometry, $this->mapper]);
129+
: $this->app->make($geometry_class, ['geometry' => $geometry, 'mapper' => $this->mapper]);
130130
}
131131
}

src/GeometryServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function boot()
2929
public function register()
3030
{
3131
$this->app->singleton('geometry', function ($app) {
32-
return $app->make(Geometry::class, [new geoPHP(), new TypeMapper(), $app]);
32+
return $app->make(Geometry::class, ['geometry' => new geoPHP(), 'mapper' => new TypeMapper(), 'app' => $app]);
3333
});
3434
}
3535
}

tests/GeometryTest.php

Lines changed: 136 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ public function it_uses_laravel_to_resolve_classes_if_was_provided()
144144
->withArgs([
145145
'Spinen\Geometry\Geometries\Polygon',
146146
[
147-
$polygon,
148-
$this->mapper_mock,
147+
'geometry' => $polygon,
148+
'mapper' => $this->mapper_mock,
149149
],
150150
])
151151
->andReturn(new GeometryProxy($polygon, $this->mapper_mock));
@@ -340,12 +340,144 @@ public function it_raises_exception_when_building_name_to_proxy_class_for_null_g
340340
*/
341341
public function it_raises_exception_when_building_name_to_proxy_class_that_does_not_exist()
342342
{
343-
$this->markTestSkipped('Now that typecasting a Geometry, there is no way to pass an invalid class to trigger this test');
344-
345343
$this->expectException(RuntimeException::class);
346344

347345
$this->geometry->buildGeometryClassName(new class extends GlobalGeometry
348346
{
347+
public function area()
348+
{
349+
// Just a stub for area() method.
350+
}
351+
352+
public function boundary()
353+
{
354+
// Just a stub for boundary() method.
355+
}
356+
357+
public function centroid()
358+
{
359+
// Just a stub for centroid() method.
360+
}
361+
362+
public function length()
363+
{
364+
// Just a stub for length() method.
365+
}
366+
367+
public function y()
368+
{
369+
// Just a stub for y() method.
370+
}
371+
372+
public function x()
373+
{
374+
// Just a stub for x() method.
375+
}
376+
377+
public function numGeometries()
378+
{
379+
// Just a stub for numGeometries() method.
380+
}
381+
382+
public function geometryN($n)
383+
{
384+
// Just a stub for geometryN() method.
385+
}
386+
387+
public function startPoint()
388+
{
389+
// Just a stub for startPoint() method.
390+
}
391+
392+
public function endPoint()
393+
{
394+
// Just a stub for endPoint() method.
395+
}
396+
397+
public function isRing()
398+
{
399+
// Just a stub for isRing() method.
400+
}
401+
402+
public function isClosed()
403+
{
404+
// Just a stub for isClosed() method.
405+
}
406+
407+
public function numPoints()
408+
{
409+
// Just a stub for numPoints() method.
410+
}
411+
412+
public function pointN($n)
413+
{
414+
// Just a stub for pointN() method.
415+
}
416+
417+
public function exteriorRing()
418+
{
419+
// Just a stub for exteriorRing() method.
420+
}
421+
422+
public function numInteriorRings()
423+
{
424+
// Just a stub for numInteriorRings() method.
425+
}
426+
427+
public function interiorRingN($n)
428+
{
429+
// Just a stub for interiorRingN() method.
430+
}
431+
432+
public function dimension()
433+
{
434+
// Just a stub for dimension() method.
435+
}
436+
437+
public function equals($geom)
438+
{
439+
// Just a stub for equals() method.
440+
}
441+
442+
public function isEmpty()
443+
{
444+
// Just a stub for isEmpty() method.
445+
}
446+
447+
public function isSimple()
448+
{
449+
// Just a stub for isSimple() method.
450+
}
451+
452+
public function getBBox()
453+
{
454+
// Just a stub for getBBox() method.
455+
}
456+
457+
public function asArray()
458+
{
459+
// Just a stub for asArray() method.
460+
}
461+
462+
public function getPoints()
463+
{
464+
// Just a stub for getPoints() method.
465+
}
466+
467+
public function explode()
468+
{
469+
// Just a stub for explode() method.
470+
}
471+
472+
public function greatCircleLength()
473+
{
474+
// Just a stub for greatCircleLength() method.
475+
}
476+
477+
public function haversineLength()
478+
{
479+
// Just a stub for haversineLength() method.
480+
}
349481
});
350482
}
351483
}

0 commit comments

Comments
 (0)