-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup tests and bugfix for configuration parameter passing
- Loading branch information
1 parent
fb7a468
commit b8e7662
Showing
6 changed files
with
81 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,171 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352"> | ||
<file src="src/Authentication/Authenticate.php"> | ||
<PossiblyUndefinedIntArrayOffset> | ||
<code>$pass</code> | ||
</PossiblyUndefinedIntArrayOffset> | ||
</file> | ||
<file src="src/Bolt/SslConfigurationFactory.php"> | ||
<LessSpecificReturnStatement> | ||
<code><![CDATA[[$sslConfig, $this->enableSsl($uri->getHost(), $sslConfig, $config)]]]></code> | ||
<code>[$sslConfig, []]</code> | ||
</LessSpecificReturnStatement> | ||
<MoreSpecificReturnType> | ||
<code><![CDATA[array{0: 's'|'ssc'|'', 1: array{verify_peer?: bool, peer_name?: string, SNI_enabled?: bool, allow_self_signed?: bool}}]]></code> | ||
</MoreSpecificReturnType> | ||
</file> | ||
<file src="src/Common/SysVSemaphore.php"> | ||
<InvalidArgument> | ||
<code><![CDATA[$this->semaphore]]></code> | ||
<code><![CDATA[$this->semaphore]]></code> | ||
<code>sem_get(hexdec($key), $max)</code> | ||
</InvalidArgument> | ||
</file> | ||
<file src="src/Databags/DatabaseInfo.php"> | ||
<MissingTemplateParam> | ||
<code>DatabaseInfo</code> | ||
</MissingTemplateParam> | ||
</file> | ||
<file src="src/Databags/Plan.php"> | ||
<MissingTemplateParam> | ||
<code>Plan</code> | ||
</MissingTemplateParam> | ||
</file> | ||
<file src="src/Databags/ProfiledPlan.php"> | ||
<MissingTemplateParam> | ||
<code>ProfiledPlan</code> | ||
</MissingTemplateParam> | ||
</file> | ||
<file src="src/Databags/ResultSummary.php"> | ||
<MissingTemplateParam> | ||
<code>ResultSummary</code> | ||
</MissingTemplateParam> | ||
</file> | ||
<file src="src/Databags/ServerInfo.php"> | ||
<MissingTemplateParam> | ||
<code>ServerInfo</code> | ||
</MissingTemplateParam> | ||
</file> | ||
<file src="src/Databags/Statement.php"> | ||
<MissingTemplateParam> | ||
<code>Statement</code> | ||
</MissingTemplateParam> | ||
</file> | ||
<file src="src/Databags/SummaryCounters.php"> | ||
<MissingTemplateParam> | ||
<code>SummaryCounters</code> | ||
</MissingTemplateParam> | ||
</file> | ||
<file src="src/Formatter/BasicFormatter.php"> | ||
<ImplementedParamTypeMismatch> | ||
<code>$meta</code> | ||
</ImplementedParamTypeMismatch> | ||
</file> | ||
<file src="src/Formatter/Specialised/JoltHttpOGMTranslator.php"> | ||
<PossiblyUndefinedArrayOffset> | ||
<code>$coordinates</code> | ||
</PossiblyUndefinedArrayOffset> | ||
</file> | ||
<file src="src/Formatter/Specialised/LegacyHttpOGMTranslator.php"> | ||
<ArgumentTypeCoercion> | ||
<code>$value</code> | ||
<code>$value</code> | ||
</ArgumentTypeCoercion> | ||
<InvalidReturnStatement> | ||
<code><![CDATA[$this->translateCypherList($value, $meta)]]></code> | ||
<code>[new CypherList($tbr), $meta]</code> | ||
</InvalidReturnStatement> | ||
<InvalidReturnType> | ||
<code>array{0: OGMTypes, 1: HttpMetaInfo}</code> | ||
</InvalidReturnType> | ||
<PossiblyUndefinedIntArrayOffset> | ||
<code>$milliseconds</code> | ||
<code>$milliseconds</code> | ||
<code>$secondsFraction</code> | ||
<code>$time</code> | ||
<code>$time</code> | ||
<code>$timezone</code> | ||
<code>$tzMinutes</code> | ||
</PossiblyUndefinedIntArrayOffset> | ||
</file> | ||
<file src="src/Formatter/SummarizedResultFormatter.php"> | ||
<InvalidArgument> | ||
<code>$response</code> | ||
</InvalidArgument> | ||
<InvalidArrayOffset> | ||
<code><![CDATA[$response['db']]]></code> | ||
</InvalidArrayOffset> | ||
</file> | ||
<file src="src/Types/Abstract3DPoint.php"> | ||
<ImplementedReturnTypeMismatch> | ||
<code>array{x: float, y: float, z: float, srid: int, crs: Crs}</code> | ||
</ImplementedReturnTypeMismatch> | ||
</file> | ||
<file src="src/Types/AbstractCypherSequence.php"> | ||
<InvalidPropertyAssignmentValue> | ||
<code><![CDATA[$this->keyCache]]></code> | ||
<code><![CDATA[$this->keyCache]]></code> | ||
</InvalidPropertyAssignmentValue> | ||
</file> | ||
<file src="src/Types/AbstractPoint.php"> | ||
<MissingTemplateParam> | ||
<code>AbstractPoint</code> | ||
</MissingTemplateParam> | ||
</file> | ||
<file src="src/Types/ArrayList.php"> | ||
<ImplementedReturnTypeMismatch> | ||
<code><![CDATA[static<TValue|NewValue>]]></code> | ||
</ImplementedReturnTypeMismatch> | ||
</file> | ||
<file src="src/Types/Map.php"> | ||
<ImplementedReturnTypeMismatch> | ||
<code><![CDATA[static<TValue|NewValue>]]></code> | ||
</ImplementedReturnTypeMismatch> | ||
</file> | ||
<file src="tests/Unit/CypherListTest.php"> | ||
<NoValue> | ||
<code>$item</code> | ||
</NoValue> | ||
<UnevaluatedCode> | ||
<code>++$counter;</code> | ||
<code>self::assertEquals(0, $counter);</code> | ||
<code><![CDATA[self::assertEquals(['A', 'B', 'C'][$key], $item);]]></code> | ||
</UnevaluatedCode> | ||
<UnusedVariable> | ||
<code>$counter</code> | ||
<code>$key</code> | ||
</UnusedVariable> | ||
</file> | ||
<file src="tests/Unit/CypherMapTest.php"> | ||
<MissingTemplateParam> | ||
<code>IteratorAggregate</code> | ||
</MissingTemplateParam> | ||
<NoValue> | ||
<code>$item</code> | ||
</NoValue> | ||
<UnevaluatedCode> | ||
<code>++$counter;</code> | ||
<code>self::assertEquals(0, $counter);</code> | ||
<code><![CDATA[self::assertEquals(['A' => 'x'][$key], $item);]]></code> | ||
</UnevaluatedCode> | ||
<UnusedVariable> | ||
<code>$counter</code> | ||
<code>$key</code> | ||
</UnusedVariable> | ||
</file> | ||
<file src="tests/Unit/DNSAddressResolverTest.php"> | ||
<InvalidOperand> | ||
<code><![CDATA[$this->resolver->getAddresses('8.8.8.8')]]></code> | ||
<code><![CDATA[$this->resolver->getAddresses('bogus')]]></code> | ||
<code><![CDATA[$this->resolver->getAddresses('test.ghlen.com')]]></code> | ||
</InvalidOperand> | ||
<NoValue> | ||
<code>$records</code> | ||
</NoValue> | ||
</file> | ||
<file src="tests/Unit/ParameterHelperTest.php"> | ||
<MissingTemplateParam> | ||
<code>Iterator</code> | ||
</MissingTemplateParam> | ||
</file> | ||
</files> | ||
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Neo4j PHP Client and Driver package. | ||
* | ||
* (c) Nagels <https://nagels.tech> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Integration; | ||
|
||
use Laudis\Neo4j\Client; | ||
use Laudis\Neo4j\ClientBuilder; | ||
use Laudis\Neo4j\Databags\DriverConfiguration; | ||
use Laudis\Neo4j\Databags\SessionConfiguration; | ||
use Laudis\Neo4j\Databags\SslConfiguration; | ||
use Laudis\Neo4j\Databags\TransactionConfiguration; | ||
use Laudis\Neo4j\Enum\SslMode; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ClientBuilderTest extends TestCase | ||
{ | ||
public function testGetClient(): void | ||
{ | ||
$sslConfig = SslConfiguration::default()->withVerifyPeer(false)->withMode(SslMode::FROM_URL()); | ||
$driverconfig = DriverConfiguration::default() | ||
->withSslConfiguration($sslConfig) | ||
->withMaxPoolSize(4096) | ||
->withAcquireConnectionTimeout(2.5); | ||
$sessionConfig = SessionConfiguration::default()->withDatabase('neo4j'); | ||
$transactionConfig = TransactionConfiguration::default()->withTimeout(120.0); | ||
$client = ClientBuilder::create() | ||
->withDefaultDriverConfiguration($driverconfig) | ||
->withDefaultSessionConfiguration($sessionConfig) | ||
->withDefaultTransactionConfiguration($transactionConfig) | ||
->build(); | ||
|
||
self::assertInstanceOf(Client::class, $client); | ||
self::assertEquals($driverconfig, $client->getDriverSetups()->getDriverConfiguration()); | ||
self::assertEquals($sslConfig, $client->getDriverSetups()->getDriverConfiguration()->getSslConfiguration()); | ||
self::assertEquals($sessionConfig, $client->getDefaultSessionConfiguration()); | ||
self::assertEquals($transactionConfig, $client->getDefaultTransactionConfiguration()); | ||
} | ||
} |