Skip to content

Commit dc76714

Browse files
mhujerpolyfractal
authored andcommitted
[TEST] PHPUnit 6.3.0 (#627)
* PHPUnit 5.7.21 + update config + fix risky tests * PHPUnit 6.3.0 * use $this->expectException instead of annotation
1 parent d393305 commit dc76714

17 files changed

+191
-182
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"guzzlehttp/ringphp" : "~1.0"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "^4.7|^5.4",
19+
"phpunit/phpunit": "6.3.0",
2020
"mockery/mockery": "0.9.4",
2121
"symfony/yaml": "^2.8",
2222
"symfony/finder": "^2.8",

phpunit-integration.xml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
<phpunit
2-
bootstrap="tests/bootstrap.php"
3-
colors="true"
4-
convertNoticesToExceptions="true"
5-
convertWarningsToExceptions="true"
6-
convertErrorsToExceptions="true"
7-
syntaxCheck="true"
8-
verbose="true"
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.3/phpunit.xsd"
4+
bootstrap="tests/bootstrap.php"
5+
colors="true"
6+
failOnRisky="true"
7+
verbose="true"
8+
beStrictAboutChangesToGlobalState="true"
9+
beStrictAboutOutputDuringTests="true"
910
>
1011
<php>
1112
<env name="ES_TEST_HOST" value="http://localhost:9200"/>
1213
</php>
1314
<testsuites>
14-
<testsuite>
15+
<testsuite name="Integration Tests">
1516
<file>tests/Elasticsearch/Tests/YamlRunnerTest.php</file>
1617
</testsuite>
1718
</testsuites>

phpunit.xml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
<phpunit
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.3/phpunit.xsd"
24
bootstrap="tests/bootstrap.php"
35
colors="true"
4-
convertNoticesToExceptions="true"
5-
convertWarningsToExceptions="true"
6-
convertErrorsToExceptions="true"
7-
syntaxCheck="true"
6+
failOnRisky="true"
87
verbose="true"
8+
beStrictAboutChangesToGlobalState="true"
9+
beStrictAboutOutputDuringTests="true"
910
>
1011
<php>
11-
<env name="ES_TEST_HOST" value="http://localhost:9200"/>
12+
<server name="ES_TEST_HOST" value="http://localhost:9200"/>
1213
</php>
1314
<testsuites>
14-
<testsuite>
15+
<testsuite name="Tests">
1516
<directory>tests</directory>
1617
<exclude>tests/Elasticsearch/Tests/YamlRunnerTest.php</exclude>
1718
</testsuite>

tests/Elasticsearch/Tests/ClientIntegrationTests.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
1313
* @link http://elasticsearch.org
1414
*/
15-
class ClientIntegrationTests extends \PHPUnit_Framework_TestCase
15+
class ClientIntegrationTests extends \PHPUnit\Framework\TestCase
1616
{
1717
public function testCustomQueryParams()
1818
{
19-
$params = array();
20-
2119
$client = Elasticsearch\ClientBuilder::create()->setHosts([$_SERVER['ES_TEST_HOST']])->build();
2220

23-
$getParams = array(
21+
$getParams = [
2422
'index' => 'test',
2523
'type' => 'test',
2624
'id' => 1,
2725
'parent' => 'abc',
28-
'custom' => array('customToken' => 'abc', 'otherToken' => 123),
26+
'custom' => ['customToken' => 'abc', 'otherToken' => 123],
2927
'client' => ['ignore' => 400]
30-
);
28+
];
3129
$exists = $client->exists($getParams);
30+
31+
$this->assertFalse($exists);
3232
}
3333

34-
}
34+
}

0 commit comments

Comments
 (0)