[TASK] Make MethodArgumentRequiredStaticMatcherTest notice free 90/56190/3
authorJan Helke <typo3@helke.de>
Thu, 15 Mar 2018 19:46:34 +0000 (20:46 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 15 Mar 2018 20:49:33 +0000 (21:49 +0100)
Releases: master
Resolves: #84317
Change-Id: Ib758d64aa3613d7af4885338f8cf856412fbd6f9
Reviewed-on: https://review.typo3.org/56190
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/MethodArgumentRequiredStaticMatcherTest.php

index aa0c8e2..adc80b1 100644 (file)
@@ -27,11 +27,6 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 class MethodArgumentRequiredStaticMatcherTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @test
      */
     public function hitsFromFixtureAreFound()
@@ -70,7 +65,7 @@ class MethodArgumentRequiredStaticMatcherTest extends UnitTestCase
     /**
      * @return array
      */
-    public function matchesReturnsExpectedRestFilesDataProvider()
+    public function matchesReturnsExpectedRestFilesDataProvider(): array
     {
         return [
             'two rest candidates with same number of arguments' => [
@@ -202,6 +197,9 @@ class MethodArgumentRequiredStaticMatcherTest extends UnitTestCase
     /**
      * @test
      * @dataProvider matchesReturnsExpectedRestFilesDataProvider
+     * @param array $configuration
+     * @param string $phpCode
+     * @param array $expected
      */
     public function matchesReturnsExpectedRestFiles(array $configuration, string $phpCode, array $expected)
     {
@@ -215,6 +213,10 @@ class MethodArgumentRequiredStaticMatcherTest extends UnitTestCase
         $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);
+        }
     }
 }