Skip to content

Commit b4e8ea0

Browse files
committed
fixed broken test and added schema for phpunit.xml
1 parent 8d96f84 commit b4e8ea0

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

phpunit.dist.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="tests/bootstrap.php">
2+
<phpunit bootstrap="tests/bootstrap.php"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
convertNoticesToExceptions="true"
6+
convertWarningsToExceptions="true"
7+
convertErrorsToExceptions="true"
8+
convertDeprecationsToExceptions="true"
9+
>>
310
<!-- Test Suite Configuration -->
411
<testsuites>
512
<testsuite name="Application Test Suite">

tests/Integration/Neo4jOGMTest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22

33
namespace Neo4j\QueryAPI\Tests\Integration;
44

5+
use Neo4j\QueryAPI\Objects\Path;
56
use Neo4j\QueryAPI\OGM;
67
use PHPUnit\Framework\TestCase;
78

8-
/**
9-
* @api
10-
*/
11-
class Neo4jOGMTest extends TestCase
9+
final class Neo4jOGMTest extends TestCase
1210
{
13-
/** @psalm-suppress PropertyNotSetInConstructor */
1411
private OGM $ogm;
1512

1613
#[\Override]
@@ -84,12 +81,11 @@ public function testWithPath(): void
8481
];
8582

8683
$path = $this->ogm->map($pathData);
87-
$nodes = iterator_to_array($path->nodes);
84+
$this->assertInstanceOf(Path::class, $path);
8885

89-
$this->assertCount(2, $nodes);
86+
$this->assertCount(2, $path->nodes);
9087
$this->assertCount(1, $path->relationships);
91-
$this->assertEquals('A', $nodes[0]->getProperties()['name']['_value']);
92-
$this->assertEquals('B', $nodes[1]->getProperties()['name']['_value']);
88+
$this->assertEquals('A', $path->nodes[0]->getProperties()['name']['_value']);
89+
$this->assertEquals('B', $path->nodes[1]->getProperties()['name']['_value']);
9390
}
94-
9591
}

0 commit comments

Comments
 (0)