diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 000000000..8c29546c7 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,9 @@ +parameters: + ignoreErrors: + - '#Mockery\\MockInterface::shouldReceive\(\)#' + - '#Mockery\\MockInterface given#' + - '#Mockery\\MockInterface\[\] given#' + + # because of \Elasticsearch\Tests\RegisteredNamespaceTest + - '#Call to an undefined method Elasticsearch\\Client::foo\(\)#' + - '#Call to an undefined method Elasticsearch\\Client::bar\(\)#' diff --git a/tests/Elasticsearch/Tests/ConnectionPool/StaticConnectionPoolTest.php b/tests/Elasticsearch/Tests/ConnectionPool/StaticConnectionPoolTest.php index 25223c95c..a87768869 100644 --- a/tests/Elasticsearch/Tests/ConnectionPool/StaticConnectionPoolTest.php +++ b/tests/Elasticsearch/Tests/ConnectionPool/StaticConnectionPoolTest.php @@ -126,6 +126,9 @@ public function testAllHostsFailPing() $this->expectException(\Elasticsearch\Common\Exceptions\NoNodesAvailableException::class); $this->expectExceptionMessage('No alive nodes found in your cluster'); + $this->expectException(\Elasticsearch\Common\Exceptions\NoNodesAvailableException::class); + $this->expectExceptionMessage('No alive nodes found in your cluster'); + $connectionPool->nextConnection(); } diff --git a/tests/Elasticsearch/Tests/YamlRunnerTest.php b/tests/Elasticsearch/Tests/YamlRunnerTest.php index 9348059d2..be8bf2fb4 100644 --- a/tests/Elasticsearch/Tests/YamlRunnerTest.php +++ b/tests/Elasticsearch/Tests/YamlRunnerTest.php @@ -169,7 +169,7 @@ public function testAsyncIntegration($testProcedure, $skip, $setupProcedure, $fi } if (null !== $setupProcedure) { - $this->processProcedure(current($setupProcedure), 'setup'); + $this->processProcedure(current($setupProcedure), 'setup', $fileName); $this->waitForYellow(); } @@ -326,6 +326,9 @@ public function operationDo($operation, $lastOperationResult, &$context, $testNa $endpointParams->client['headers'] = $headers; } + if (!is_string($method)) { + throw new \Exception('$method must be string'); + } list($method, $namespace) = $this->mapEndpoint($method, $namespace); if (null !== $namespace) { @@ -404,7 +407,7 @@ public function executeRequest($caller, $method, $endpointParams, $expectedError * * @throws \Exception * - * @return bool + * @return bool|mixed[] */ public function executeAsyncExistRequest($caller, $method, $endpointParams, $expectedError, $expectedWarnings, $testName) {