From d1b7f4f80391de2a4874779119e14c169ca4ac07 Mon Sep 17 00:00:00 2001 From: Github Date: Thu, 9 Sep 2021 14:06:24 +0200 Subject: [PATCH] fix: python version and tests --- Dockerfile | 3 + composer.json | 4 +- composer.lock | 125 ++++++++++++++++++++---------------- features/FeatureContext.php | 16 ++--- 4 files changed, 82 insertions(+), 66 deletions(-) diff --git a/Dockerfile b/Dockerfile index 979d21e..0edb29b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,11 +12,14 @@ RUN (curl -sL https://deb.nodesource.com/setup_16.x | bash) \ locales \ nodejs \ perl \ + python \ + python-pip \ python3 \ python3-pip \ ruby-full \ unzip \ zlib1g-dev \ + && pip install docutils==0.14 \ && pip3 install docutils==0.14 \ && gem install bundler \ && rm -rf /var/lib/apt/lists/* \ diff --git a/composer.json b/composer.json index 9752f2e..4d3f2fd 100644 --- a/composer.json +++ b/composer.json @@ -6,11 +6,11 @@ "symfony/process": "^5.1" }, "require-dev": { + "beberlei/assert": "^3.3", "behat/behat": "^3.5", "guzzlehttp/guzzle": "^7.2", "pedrotroller/php-cs-custom-fixer": "^2.15", - "sebastian/diff": "^4.0", - "webmozart/assert": "^1.3" + "sebastian/diff": "^4.0" }, "autoload-dev": { "psr-4": { diff --git a/composer.lock b/composer.lock index c4e30cf..17222a1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "47e8fc8ac481639dba08798ffafc1035", + "content-hash": "7c3d4a5219f751a79fd02085d86718b0", "packages": [ { "name": "container-interop/container-interop", @@ -486,6 +486,73 @@ } ], "packages-dev": [ + { + "name": "beberlei/assert", + "version": "v3.3.1", + "source": { + "type": "git", + "url": "https://github.com/beberlei/assert.git", + "reference": "5e721d7e937ca3ba2cdec1e1adf195f9e5188372" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beberlei/assert/zipball/5e721d7e937ca3ba2cdec1e1adf195f9e5188372", + "reference": "5e721d7e937ca3ba2cdec1e1adf195f9e5188372", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "php": "^7.0 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "*", + "phpstan/phpstan": "*", + "phpunit/phpunit": ">=6.0.0", + "yoast/phpunit-polyfills": "^0.1.0" + }, + "suggest": { + "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" + }, + "type": "library", + "autoload": { + "psr-4": { + "Assert\\": "lib/Assert" + }, + "files": [ + "lib/Assert/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de", + "role": "Lead Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Collaborator" + } + ], + "description": "Thin assertion library for input validation in business models.", + "keywords": [ + "assert", + "assertion", + "validation" + ], + "support": { + "issues": "https://github.com/beberlei/assert/issues", + "source": "https://github.com/beberlei/assert/tree/v3.3.1" + }, + "time": "2021-04-18T20:11:03+00:00" + }, { "name": "behat/behat", "version": "v3.8.1", @@ -3281,60 +3348,6 @@ } ], "time": "2020-10-24T12:03:25+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], @@ -3344,5 +3357,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.1.0" } diff --git a/features/FeatureContext.php b/features/FeatureContext.php index a0984e7..fbd596a 100644 --- a/features/FeatureContext.php +++ b/features/FeatureContext.php @@ -2,6 +2,7 @@ declare(strict_types=1); +use Assert\InvalidArgumentException; use Behat\Behat\Tester\Exception\PendingException; use Behat\Behat\Context\Context; use Behat\Gherkin\Node\PyStringNode; @@ -10,7 +11,7 @@ use GuzzleHttp\Exception\ServerException; use Psr\Http\Message\ResponseInterface; use SebastianBergmann\Diff\Differ; -use Webmozart\Assert\Assert; +use Assert\Assert; final class FeatureContext implements Context { @@ -63,13 +64,11 @@ public function iShouldGetTheFollowingHtml(PyStringNode $html): void throw new Exception('No request sent.'); } - Assert::eq($this->response->getStatusCode(), 200); - try { - Assert::eq( - (string) $this->response->getBody(), - (string) $html, - ); + Assert::that($this->response->getStatusCode()) + ->eq(200); + Assert::that((string) $this->response->getBody()) + ->eq($html); } catch (InvalidArgumentException $exception) { echo (new Differ())->diff( (string) $html, @@ -89,6 +88,7 @@ public function iShouldGetAnUnexpectedMediaTypeHttpResponse(): void throw new Exception('No request sent.'); } - Assert::eq($this->response->getStatusCode(), 415); + Assert::that($this->response->getStatusCode()) + ->eq(415); } }