From 0fdb1f344294c0d3afc1f358e8b93ff1a2294a5c Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Sat, 22 Nov 2025 22:07:17 +0100 Subject: [PATCH 1/4] fix: update tests --- src/HttpCall/Request/BrowserKit.php | 2 +- tests/features/{ => en}/browser.feature | 0 tests/features/{ => en}/debug.feature | 0 tests/features/{ => en}/json.feature | 0 tests/features/{ => en}/rest.feature | 2 +- tests/features/{ => en}/system.feature | 0 tests/features/{ => en}/table.feature | 0 tests/features/{ => en}/xml.feature | 0 8 files changed, 2 insertions(+), 2 deletions(-) rename tests/features/{ => en}/browser.feature (100%) rename tests/features/{ => en}/debug.feature (100%) rename tests/features/{ => en}/json.feature (100%) rename tests/features/{ => en}/rest.feature (99%) rename tests/features/{ => en}/system.feature (100%) rename tests/features/{ => en}/table.feature (100%) rename tests/features/{ => en}/xml.feature (100%) diff --git a/src/HttpCall/Request/BrowserKit.php b/src/HttpCall/Request/BrowserKit.php index b842a319..7153288d 100644 --- a/src/HttpCall/Request/BrowserKit.php +++ b/src/HttpCall/Request/BrowserKit.php @@ -62,7 +62,7 @@ public function send($method, $url, $parameters = [], $files = [], $content = nu { foreach ($files as $originalName => &$file) { if (\is_string($file)) { - $file = new UploadedFile($file, (string) $originalName); + $file = ['tmp_name' => $file, 'name' => basename($file)]; } } diff --git a/tests/features/browser.feature b/tests/features/en/browser.feature similarity index 100% rename from tests/features/browser.feature rename to tests/features/en/browser.feature diff --git a/tests/features/debug.feature b/tests/features/en/debug.feature similarity index 100% rename from tests/features/debug.feature rename to tests/features/en/debug.feature diff --git a/tests/features/json.feature b/tests/features/en/json.feature similarity index 100% rename from tests/features/json.feature rename to tests/features/en/json.feature diff --git a/tests/features/rest.feature b/tests/features/en/rest.feature similarity index 99% rename from tests/features/rest.feature rename to tests/features/en/rest.feature index 0b0a93c2..dca866e5 100644 --- a/tests/features/rest.feature +++ b/tests/features/en/rest.feature @@ -100,7 +100,7 @@ Feature: Testing RESTContext Scenario: Accept header should not be set by dfault When I send a GET request to "/rest/index.php" - Then I should not see "HTTP_ACCEPT" + Then I should not see "HTTP_ACCEPT :" @>php5.5 Scenario: Set content headers in POST request diff --git a/tests/features/system.feature b/tests/features/en/system.feature similarity index 100% rename from tests/features/system.feature rename to tests/features/en/system.feature diff --git a/tests/features/table.feature b/tests/features/en/table.feature similarity index 100% rename from tests/features/table.feature rename to tests/features/en/table.feature diff --git a/tests/features/xml.feature b/tests/features/en/xml.feature similarity index 100% rename from tests/features/xml.feature rename to tests/features/en/xml.feature From 5556775ac556824c21f50d5479656d4e132b9641 Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Mon, 24 Nov 2025 16:45:55 +0100 Subject: [PATCH 2/4] revert --- .github/workflows/ci.yml | 2 +- src/HttpCall/Request/BrowserKit.php | 2 +- tests/features/ja/browser.feature | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfd3fcf8..e7abc8dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -169,4 +169,4 @@ jobs: while ! nc -z localhost 8080 &$file) { if (\is_string($file)) { - $file = ['tmp_name' => $file, 'name' => basename($file)]; + $file = new UploadedFile($file, (string) $originalName); } } diff --git a/tests/features/ja/browser.feature b/tests/features/ja/browser.feature index 4dad9445..bedde7b1 100644 --- a/tests/features/ja/browser.feature +++ b/tests/features/ja/browser.feature @@ -9,7 +9,7 @@ @javascript シナリオ: Testing simple web access 前提 "/index.html" を表示している - ならば 画面に "Congratulations, you've correctly set up your apache environment." と表示されていること + ならば 画面に "Congratulations, you've correctly set up your apache environment." と表示されていること @statusCode シナリオ: Basic authentication @@ -65,9 +65,9 @@ ならば 私が"timeout"を見るまで3秒間待つ かつ 私が1秒間待つ かつ 私が"#iframe"要素を見るまで待つ - かつ 私が "#iframe" 要素を見るまで 5 秒間待つ - かつ 私が "#iframe" 要素を見るまで 5 秒待つ - かつ "#iframe" 要素を見るまで 5 秒待つ + かつ 私が "#iframe" 要素を見るまで 5 秒間待つ + かつ 私が "#iframe" 要素を見るまで 5 秒待つ + かつ "#iframe" 要素を見るまで 5 秒待つ @javascript シナリオ: Check element visibility From 15c9a935302ad2ef89bf2232e05bbf8e36d90a67 Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Sat, 29 Nov 2025 15:37:29 +0100 Subject: [PATCH 3/4] set language --- tests/features/en/browser.feature | 1 + tests/features/en/debug.feature | 1 + tests/features/en/json.feature | 1 + tests/features/en/rest.feature | 1 + tests/features/en/system.feature | 1 + tests/features/en/table.feature | 1 + tests/features/en/xml.feature | 1 + 7 files changed, 7 insertions(+) diff --git a/tests/features/en/browser.feature b/tests/features/en/browser.feature index b95375d3..46b932f7 100644 --- a/tests/features/en/browser.feature +++ b/tests/features/en/browser.feature @@ -1,3 +1,4 @@ +# language: en Feature: Browser Feature # If this scenario fails diff --git a/tests/features/en/debug.feature b/tests/features/en/debug.feature index 81990716..ed75d43a 100644 --- a/tests/features/en/debug.feature +++ b/tests/features/en/debug.feature @@ -1,3 +1,4 @@ +# language: en Feature: Browser Feature @user diff --git a/tests/features/en/json.feature b/tests/features/en/json.feature index df6685c3..e2874b81 100644 --- a/tests/features/en/json.feature +++ b/tests/features/en/json.feature @@ -1,3 +1,4 @@ +# language: en @json Feature: Testing JSONContext diff --git a/tests/features/en/rest.feature b/tests/features/en/rest.feature index dca866e5..a08054ae 100644 --- a/tests/features/en/rest.feature +++ b/tests/features/en/rest.feature @@ -1,3 +1,4 @@ +# language: en @rest Feature: Testing RESTContext diff --git a/tests/features/en/system.feature b/tests/features/en/system.feature index f516360a..88214d1d 100644 --- a/tests/features/en/system.feature +++ b/tests/features/en/system.feature @@ -1,3 +1,4 @@ +# language: en Feature: System feature Scenario: Testing execution diff --git a/tests/features/en/table.feature b/tests/features/en/table.feature index 6584624e..a0eaf4d0 100644 --- a/tests/features/en/table.feature +++ b/tests/features/en/table.feature @@ -1,3 +1,4 @@ +# language: en Feature: Browser Feature Scenario: Testing access to /table/index.html diff --git a/tests/features/en/xml.feature b/tests/features/en/xml.feature index 24645c2d..d8e02d2b 100644 --- a/tests/features/en/xml.feature +++ b/tests/features/en/xml.feature @@ -1,3 +1,4 @@ +# language: en @xml Feature: Testing XmlContext From dadcfb04a6ab4412bacb28ca7b387c89f1b91469 Mon Sep 17 00:00:00 2001 From: "hubert.lenoir" Date: Sat, 29 Nov 2025 15:41:15 +0100 Subject: [PATCH 4/4] cs --- src/Json/Json.php | 4 ++-- src/Xml/Dom.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Json/Json.php b/src/Json/Json.php index f8694474..9f954253 100644 --- a/src/Json/Json.php +++ b/src/Json/Json.php @@ -4,7 +4,7 @@ use Symfony\Component\PropertyAccess\PropertyAccessor; -class Json +class Json implements \Stringable { protected $content; @@ -45,7 +45,7 @@ public function encode($pretty = true) return json_encode($this->content, $flags); } - public function __toString() + public function __toString(): string { return $this->encode(false); } diff --git a/src/Xml/Dom.php b/src/Xml/Dom.php index 2b3488e7..f6de33d8 100644 --- a/src/Xml/Dom.php +++ b/src/Xml/Dom.php @@ -2,7 +2,7 @@ namespace Behatch\Xml; -class Dom +class Dom implements \Stringable { private $dom; @@ -16,7 +16,7 @@ public function __construct($content) $this->throwError(); } - public function __toString() + public function __toString(): string { $this->dom->formatOutput = true;