[TASK] Make TaskTest notice free 97/56297/3
authorSascha Löffler <lsascha@gmail.com>
Sat, 17 Mar 2018 12:38:06 +0000 (13:38 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 17 Mar 2018 14:15:08 +0000 (15:15 +0100)
Resolves: #84426
Releases: master
Change-Id: I2de52b5ddaacdfb9f8e29a11009ef7db3d9e1c46
Reviewed-on: https://review.typo3.org/56297
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
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/extbase/Classes/Scheduler/Task.php
typo3/sysext/extbase/Tests/Unit/Scheduler/TaskTest.php

index 614dfdc..384a289 100644 (file)
@@ -178,7 +178,7 @@ class Task extends AbstractTask
         if (!empty($this->arguments)) {
             $arguments = [];
             foreach ($this->arguments as $argumentName => $argumentValue) {
-                if ($argumentValue != $this->defaults[$argumentName]) {
+                if (!isset($this->defaults[$argumentName]) || $argumentValue != $this->defaults[$argumentName]) {
                     $arguments[] = $argumentName . '=' . $argumentValue;
                 }
             }
index 34bb8e5..baec05c 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types = 1);
 namespace TYPO3\CMS\Extbase\Tests\Unit\Scheduler;
 
 /*
@@ -14,17 +15,16 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Scheduler;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Scheduler\Task;
+use TYPO3\CMS\Extbase\Scheduler\TaskExecutor;
+use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
+
 /**
  * Test case
  */
-class TaskTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
+class TaskTest extends UnitTestCase
 {
     /**
-     * Subject is not notice free, disable E_NOTICES
-     */
-    protected static $suppressNotices = true;
-
-    /**
      * @var \TYPO3\CMS\Extbase\Scheduler\Task|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface
      */
     protected $task;
@@ -36,11 +36,11 @@ class TaskTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
 
     protected function setUp()
     {
-        $this->taskExecutor = $this->getMockBuilder(\TYPO3\CMS\Extbase\Scheduler\TaskExecutor::class)
+        $this->taskExecutor = $this->getMockBuilder(TaskExecutor::class)
             ->setMethods(['execute'])
             ->disableOriginalConstructor()
             ->getMock();
-        $this->task = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Scheduler\Task::class, ['logException', '__wakeup'], [], '', false);
+        $this->task = $this->getAccessibleMock(Task::class, ['logException', '__wakeup'], [], '', false);
     }
 
     /**