From 1289caf6b63f433599946f870c28158e387ea52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20B=C3=B6sing?= <2189546+boesing@users.noreply.github.com> Date: Mon, 6 Mar 2023 17:41:28 +0100 Subject: [PATCH] qa: add failing test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com> --- tests/acceptance/SprintfNonEmptyString.feature | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/acceptance/SprintfNonEmptyString.feature b/tests/acceptance/SprintfNonEmptyString.feature index f8f19df..a198930 100644 --- a/tests/acceptance/SprintfNonEmptyString.feature +++ b/tests/acceptance/SprintfNonEmptyString.feature @@ -307,3 +307,16 @@ Feature: non empty template passed to sprintf results in non-empty-string """ When I run psalm Then I see no errors + +Scenario: Template is non-empty-string based on union types which are all literal strings with a length > 0 + Given I have the following code + """ + $foo = 'bar %s'; + if (random_int(0,1) === 1) { + $foo = 'baz %s'; + } + + nonEmptyString(sprintf($foo, '')); + """ + When I run psalm + Then I see no errors