[TASK] Make FileSizeValidatorTest.php notice free 31/56231/2
authorSascha Löffler <lsascha@gmail.com>
Fri, 16 Mar 2018 14:54:12 +0000 (15:54 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 16 Mar 2018 15:19:08 +0000 (16:19 +0100)
Resolves: #84350
Releases: master
Change-Id: I4ab0027f86517f6f607a891a2ad5a1417935af1b
Reviewed-on: https://review.typo3.org/56231
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/form/Tests/Unit/Mvc/Validation/FileSizeValidatorTest.php

index 37da2f7..f752469 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types = 1);
 namespace TYPO3\CMS\Form\Tests\Unit\Mvc\Validation;
 
 /*
@@ -18,18 +19,14 @@ use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\ResourceStorage;
 use TYPO3\CMS\Form\Mvc\Validation\Exception\InvalidValidationOptionsException;
 use TYPO3\CMS\Form\Mvc\Validation\FileSizeValidator;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
 /**
  * Test case
  */
-class FileSizeValidatorTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class FileSizeValidatorTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @test
      */
     public function FileSizeValidatorThrowsExceptionIfMinimumOptionIsInvalid()
@@ -78,7 +75,7 @@ class FileSizeValidatorTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa
             ->disableOriginalConstructor()
             ->getMock();
 
-        $file = new File(['identifier' => '/foo', 'size' => '1'], $mockedStorage);
+        $file = new File(['identifier' => '/foo', 'name'=> 'bar.txt', 'size' => '1'], $mockedStorage);
         $this->assertTrue($validator->validate($file)->hasErrors());
     }
 
@@ -97,7 +94,7 @@ class FileSizeValidatorTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa
             ->disableOriginalConstructor()
             ->getMock();
 
-        $file = new File(['identifier' => '/foo', 'size' => '1048577'], $mockedStorage);
+        $file = new File(['identifier' => '/foo', 'name' => 'bar.txt', 'size' => '1048577'], $mockedStorage);
         $this->assertTrue($validator->validate($file)->hasErrors());
     }