diff --git a/Classes/Scheduler/Provider/AbstractProvider.php b/Classes/Scheduler/Provider/AbstractProvider.php index 3d29502f..faf2d800 100644 --- a/Classes/Scheduler/Provider/AbstractProvider.php +++ b/Classes/Scheduler/Provider/AbstractProvider.php @@ -48,7 +48,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) $additionalFields = array(); // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldController] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldController] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldController] = $task->{$this->fieldController}; } @@ -67,7 +67,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldSite] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldSite] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldSite] = $task->{$this->fieldSite}; } @@ -86,7 +86,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldTSconfig] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldTSconfig] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldTSconfig] = $task->{$this->fieldTSconfig}; } diff --git a/Classes/Scheduler/Provider/Email.php b/Classes/Scheduler/Provider/Email.php index f43ef1ef..966ec632 100644 --- a/Classes/Scheduler/Provider/Email.php +++ b/Classes/Scheduler/Provider/Email.php @@ -53,7 +53,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldSenderFrom] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldSenderFrom] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldSenderFrom] = $task->{$this->fieldSenderFrom}; } @@ -71,7 +71,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldSenderEmail] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldSenderEmail] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldSenderEmail] = $task->{$this->fieldSenderEmail}; } @@ -89,7 +89,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldReplyEmail] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldReplyEmail] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldReplyEmail] = $task->{$this->fieldReplyEmail}; } @@ -107,7 +107,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldPageCatalog] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldPageCatalog] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldPageCatalog] = $task->{$this->fieldPageCatalog}; } @@ -125,7 +125,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldPageDetail] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldPageDetail] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldPageDetail] = $task->{$this->fieldPageDetail}; } @@ -143,7 +143,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldPageDownload] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldPageDownload] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldPageDownload] = $task->{$this->fieldPageDownload}; } @@ -161,7 +161,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldPageLogin] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldPageLogin] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldPageLogin] = $task->{$this->fieldPageLogin}; } @@ -179,7 +179,7 @@ protected function getFields( array &$taskInfo, $task, $parentObject ) // In case of editing a task, set to the internal value if data wasn't already submitted - if( empty( $taskInfo[$this->fieldTemplateBaseurl] ) && $parentObject->getCurrentAction() === Action::EDIT ) { + if( empty( $taskInfo[$this->fieldTemplateBaseurl] ) && $parentObject->getCurrentAction()->equals( Action::EDIT ) ) { $taskInfo[$this->fieldTemplateBaseurl] = $task->{$this->fieldTemplateBaseurl}; } diff --git a/Tests/Unit/Scheduler/Provider/Email6Test.php b/Tests/Unit/Scheduler/Provider/Email6Test.php index 85138081..9d77e488 100644 --- a/Tests/Unit/Scheduler/Provider/Email6Test.php +++ b/Tests/Unit/Scheduler/Provider/Email6Test.php @@ -5,11 +5,11 @@ use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; +use TYPO3\CMS\Scheduler\Task\Enumeration\Action; use Aimeos\Aimeos\Scheduler; -class Email6Test - extends \TYPO3\CMS\Core\Tests\UnitTestCase +class Email6Test extends \TYPO3\CMS\Core\Tests\UnitTestCase { private $object; @@ -33,7 +33,6 @@ public function getAdditionalFields() { $taskInfo = array(); $module = new SchedulerModuleController(); - $module->CMD = 'edit'; $result = $this->object->getAdditionalFields( $taskInfo, $this->object, $module ); @@ -54,7 +53,7 @@ public function getAdditionalFieldsException() { $taskInfo = array(); $module = new SchedulerModuleController(); - $module->CMD = 'edit'; + $module->setCurrentAction( new Action( 'EDIT' ) ); $mock = $this->getMockBuilder( '\Aimeos\Aimeos\Scheduler\Provider\Email6' ) ->setMethods( array( 'getFields' ) )->getMock(); diff --git a/Tests/Unit/Scheduler/Provider/Typo6Test.php b/Tests/Unit/Scheduler/Provider/Typo6Test.php index 6ca9ec0f..1ba5eb04 100644 --- a/Tests/Unit/Scheduler/Provider/Typo6Test.php +++ b/Tests/Unit/Scheduler/Provider/Typo6Test.php @@ -5,10 +5,10 @@ use TYPO3\CMS\Scheduler\Controller\SchedulerModuleController; +use TYPO3\CMS\Scheduler\Task\Enumeration\Action; -class Typo6Test - extends \TYPO3\CMS\Core\Tests\UnitTestCase +class Typo6Test extends \TYPO3\CMS\Core\Tests\UnitTestCase { private $object; @@ -32,7 +32,7 @@ public function getAdditionalFields() { $taskInfo = array(); $module = new SchedulerModuleController(); - $module->CMD = 'edit'; + $module->setCurrentAction( new Action( 'EDIT' ) ); $result = $this->object->getAdditionalFields( $taskInfo, $this->object, $module ); @@ -50,7 +50,7 @@ public function getAdditionalFieldsException() { $taskInfo = array(); $module = new SchedulerModuleController(); - $module->CMD = 'edit'; + $module->setCurrentAction( new Action( 'EDIT' ) ); $mock = $this->getMockBuilder( '\Aimeos\Aimeos\Scheduler\Provider\Typo6' ) ->setMethods( array( 'getFields' ) )->getMock();