From 7e43e48f2b8aa35357c6c121d1a1eba356ad0e79 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Mon, 2 Oct 2023 14:54:33 +0200 Subject: [PATCH] Double assertion with if clause to satisfy phpstan in tests --- tests/MDPlausiForLegalStatusTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/MDPlausiForLegalStatusTest.php b/tests/MDPlausiForLegalStatusTest.php index 83cfeda..125ee9c 100644 --- a/tests/MDPlausiForLegalStatusTest.php +++ b/tests/MDPlausiForLegalStatusTest.php @@ -145,6 +145,10 @@ final class MDPlausiForLegalStatusTest extends TestCase { self::assertEquals(MDPlausiLegalCheckResultType::expect_restricted_legal_status, $warningStatus['msgs'][0]['type']); self::assertArrayHasKey('additional', $warningStatus['msgs'][0]); + // For phpstan + if (empty($warningStatus['msgs'][0]['additional'])) { + throw new Exception("Output array should have key 'additional'"); + } self::assertEquals(MDCopyrightCollective::vg_bildkunst, $warningStatus['msgs'][0]['additional']['representation']); }