Skip to content

Commit

Permalink
[TEST] PHPUnit 6.3.0 (#627)
Browse files Browse the repository at this point in the history
* PHPUnit 5.7.21 + update config + fix risky tests

* PHPUnit 6.3.0

* use $this->expectException instead of annotation
  • Loading branch information
mhujer authored and polyfractal committed Sep 12, 2017
1 parent d393305 commit dc76714
Show file tree
Hide file tree
Showing 17 changed files with 191 additions and 182 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"guzzlehttp/ringphp" : "~1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.7|^5.4",
"phpunit/phpunit": "6.3.0",
"mockery/mockery": "0.9.4",
"symfony/yaml": "^2.8",
"symfony/finder": "^2.8",
Expand Down
19 changes: 10 additions & 9 deletions phpunit-integration.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<phpunit
bootstrap="tests/bootstrap.php"
colors="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertErrorsToExceptions="true"
syntaxCheck="true"
verbose="true"
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.3/phpunit.xsd"
bootstrap="tests/bootstrap.php"
colors="true"
failOnRisky="true"
verbose="true"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
>
<php>
<env name="ES_TEST_HOST" value="http://localhost:9200"/>
</php>
<testsuites>
<testsuite>
<testsuite name="Integration Tests">
<file>tests/Elasticsearch/Tests/YamlRunnerTest.php</file>
</testsuite>
</testsuites>
Expand Down
15 changes: 8 additions & 7 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<phpunit
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.3/phpunit.xsd"
bootstrap="tests/bootstrap.php"
colors="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertErrorsToExceptions="true"
syntaxCheck="true"
failOnRisky="true"
verbose="true"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
>
<php>
<env name="ES_TEST_HOST" value="http://localhost:9200"/>
<server name="ES_TEST_HOST" value="http://localhost:9200"/>
</php>
<testsuites>
<testsuite>
<testsuite name="Tests">
<directory>tests</directory>
<exclude>tests/Elasticsearch/Tests/YamlRunnerTest.php</exclude>
</testsuite>
Expand Down
14 changes: 7 additions & 7 deletions tests/Elasticsearch/Tests/ClientIntegrationTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elasticsearch.org
*/
class ClientIntegrationTests extends \PHPUnit_Framework_TestCase
class ClientIntegrationTests extends \PHPUnit\Framework\TestCase
{
public function testCustomQueryParams()
{
$params = array();

$client = Elasticsearch\ClientBuilder::create()->setHosts([$_SERVER['ES_TEST_HOST']])->build();

$getParams = array(
$getParams = [
'index' => 'test',
'type' => 'test',
'id' => 1,
'parent' => 'abc',
'custom' => array('customToken' => 'abc', 'otherToken' => 123),
'custom' => ['customToken' => 'abc', 'otherToken' => 123],
'client' => ['ignore' => 400]
);
];
$exists = $client->exists($getParams);

$this->assertFalse($exists);
}

}
}
Loading

0 comments on commit dc76714

Please sign in to comment.