From 0c8ea1f0de36e736e465f14f5e1a7bab61ec5818 Mon Sep 17 00:00:00 2001 From: Jan Helke Date: Thu, 15 Mar 2018 20:52:23 +0100 Subject: [PATCH] [TASK] Make MethodCallMatcherTest notice free Releases: master Resolves: #84319 Change-Id: Iabb6167b952d5cbd456b9829452ca835f432af30 Reviewed-on: https://review.typo3.org/56192 Tested-by: TYPO3com Reviewed-by: Anja Leichsenring Tested-by: Anja Leichsenring Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn --- .../Php/Matcher/MethodCallMatcherTest.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/MethodCallMatcherTest.php b/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/MethodCallMatcherTest.php index f4e69f0e121e..f0b5f8bb1ded 100644 --- a/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/MethodCallMatcherTest.php +++ b/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/MethodCallMatcherTest.php @@ -26,11 +26,6 @@ */ class MethodCallMatcherTest extends UnitTestCase { - /** - * Subject is not notice free, disable E_NOTICES - */ - protected static $suppressNotices = true; - /** * @test */ @@ -112,7 +107,7 @@ public function aTest() /** * @return array */ - public function matchesReturnsExpectedRestFilesDataProvider() + public function matchesReturnsExpectedRestFilesDataProvider(): array { return [ 'two rest candidates with same number of arguments' => [ @@ -314,6 +309,9 @@ public function matchesReturnsExpectedRestFilesDataProvider() /** * @test * @dataProvider matchesReturnsExpectedRestFilesDataProvider + * @param array $configuration + * @param string $phpCode + * @param array $expected */ public function matchesReturnsExpectedRestFiles(array $configuration, string $phpCode, array $expected) { @@ -327,6 +325,10 @@ public function matchesReturnsExpectedRestFiles(array $configuration, string $ph $traverser->traverse($statements); $result = $subject->getMatches(); - $this->assertEquals($expected[0]['restFiles'], $result[0]['restFiles']); + if (isset($expected[0], $result[0])) { + $this->assertEquals($expected[0]['restFiles'], $result[0]['restFiles']); + } else { + $this->assertEquals($expected, $result); + } } }