diff --git a/.ci/Dockerfile b/.ci/Dockerfile index 271de124d..6383e4b46 100644 --- a/.ci/Dockerfile +++ b/.ci/Dockerfile @@ -1,4 +1,4 @@ -ARG PHP_VERSION=7.4-cli +ARG PHP_VERSION=8.0-cli FROM php:${PHP_VERSION} WORKDIR /usr/src/app diff --git a/.ci/docker/Dockerfile b/.ci/docker/Dockerfile index ea6898049..138fb1cb6 100644 --- a/.ci/docker/Dockerfile +++ b/.ci/docker/Dockerfile @@ -1,4 +1,4 @@ -ARG PHP_VERSION=7.4-cli +ARG PHP_VERSION=8.0-cli FROM php:${PHP_VERSION} # Create app directory diff --git a/phpunit-yaml-platinum-tests.xml b/phpunit-yaml-platinum-tests.xml index 77468439b..270798f55 100644 --- a/phpunit-yaml-platinum-tests.xml +++ b/phpunit-yaml-platinum-tests.xml @@ -12,7 +12,7 @@ - tests/Elasticsearch/Tests/Yaml/Platinum + tests/Yaml/Platinum diff --git a/tests/Utility.php b/tests/Utility.php index 1f928fdbf..f34f2c085 100644 --- a/tests/Utility.php +++ b/tests/Utility.php @@ -17,7 +17,7 @@ use Exception; use Elastic\Elasticsearch\Client; use Elastic\Elasticsearch\ClientBuilder; -use Elastic\Elasticsearch\Exceptions\ElasticsearchException; +use Elastic\Elasticsearch\Exception\ElasticsearchException; class Utility { @@ -333,7 +333,7 @@ private static function waitForPendingTasks(Client $client, string $filter, int $result = $client->cat()->tasks([ 'detailed' => true ]); - $tasks = explode("\n", $result); + $tasks = explode("\n", $result->asString()); $count = 0; foreach ($tasks as $task) { if (empty($task)) { diff --git a/util/RestSpecRunner.php b/util/RestSpecRunner.php index b76d854e8..42f9a85f3 100644 --- a/util/RestSpecRunner.php +++ b/util/RestSpecRunner.php @@ -12,23 +12,15 @@ * the GNU Lesser General Public License, Version 2.1, at your option. * See the LICENSE file in the project root for more information. */ - - declare(strict_types = 1); use Elastic\Transport\Exception\NoNodeAvailableException; use Elastic\Elasticsearch\Tests\Utility; -// Set the default timezone. While this doesn't cause any tests to fail, PHP -// complains if it is not set in 'date.timezone' of php.ini. +// Set the default timezone. While this doesn't cause any tests to fail, +// PHP can complains if it is not set in 'date.timezone' of php.ini. date_default_timezone_set('UTC'); -// Ensure that composer has installed all dependencies -if (!file_exists(dirname(__DIR__) . '/composer.lock')) { - die("Dependencies must be installed using composer:\n\nphp composer.phar install --dev\n\n" - . "See http://getcomposer.org for help with installing composer\n"); -} - require dirname(__DIR__) . '/vendor/autoload.php'; printf("********************************************************\n"); @@ -46,8 +38,8 @@ printf ("ERROR: Host %s is offline\n", Utility::getHost()); exit(1); } - $version = $serverInfo['version']['number']; + $artifactFile = sprintf("rest-resources-zip-%s.zip", $version); $tempFilePath = sprintf("%s/%s.zip", sys_get_temp_dir(), $serverInfo['version']['build_hash']); diff --git a/util/YamlTests.php b/util/YamlTests.php index 52b0dc09c..c52cec2b1 100644 --- a/util/YamlTests.php +++ b/util/YamlTests.php @@ -131,6 +131,7 @@ private function getAllTests(string $dir): array // Iterate over the Yaml test files foreach (new RecursiveIteratorIterator($it) as $file) { if ($file->getExtension() === 'yml') { + printf ("Parsing file %s\n", $file->getPathname()); $test = yaml_parse_file($file->getPathname(), -1, $ndocs, [ YAML_MAP_TAG => function($value, $tag, $flags) { return empty($value) ? new stdClass : $value;