[TASK] Remove extra check for pageNotFoundHandling 74/57074/6
authorBenni Mack <benni@typo3.org>
Mon, 28 May 2018 19:53:11 +0000 (21:53 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 9 Jun 2018 15:59:44 +0000 (17:59 +0200)
This fixes a functional test in EXT:workspaces,
allowing for getting rid of an extra check in the
frontend request workflow.

Resolves: #85199
Releases: master
Change-Id: I642fca3a2873f0fe758164fca3f9261480dbc4da
Reviewed-on: https://review.typo3.org/57074
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php

index 63d4bc6..2daf787 100644 (file)
@@ -1314,9 +1314,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             $this->pageNotFound = 1;
         }
         $timeTracker->pull();
-        // @todo: in the future, the check if "pageNotFound_handling" is configured should go away, but this breaks
-        // Functional tests in workspaces currently
-        if ($this->pageNotFound && $GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling']) {
+        if ($this->pageNotFound) {
             $pNotFoundMsg = [
                 1 => 'ID was not an accessible page',
                 2 => 'Subsection was found and not accessible',
index 928e568..a282f5a 100644 (file)
@@ -454,9 +454,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         parent::createContentAndCopyDraftPage();
         $this->assertAssertionDataSet('createContentAndCopyDraftPage');
 
-        $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
-        $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
-            ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
+        $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
+        $this->assertContains('Reason: ID was not an accessible page', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
             ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1'));
@@ -488,9 +487,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         parent::createPageAndCopyDraftParentPage();
         $this->assertAssertionDataSet('createPageAndCopyDraftParentPage');
 
-        $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
-        $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
-            ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
+        $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
+        $this->assertContains('Reason: ID was not an accessible page', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
             ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
@@ -522,9 +520,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         parent::createNestedPagesAndCopyDraftParentPage();
         $this->assertAssertionDataSet('createNestedPagesAndCopyDraftParentPage');
 
-        $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
-        $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
-            ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
+        $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
+        $this->assertContains('Reason: ID was not an accessible page', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
             ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1'));
@@ -556,9 +553,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         parent::deleteContentAndCopyDraftPage();
         $this->assertAssertionDataSet('deleteContentAndCopyDraftPage');
 
-        $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
-        $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
-            ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
+        $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
+        $this->assertContains('Reason: ID was not an accessible page', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
             ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));
@@ -593,9 +589,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         parent::changeContentSortingAndCopyDraftPage();
         $this->assertAssertionDataSet('changeContentSortingAndCopyDraftPage');
 
-        $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
-        $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
-            ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
+        $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
+        $this->assertContains('Reason: ID was not an accessible page', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint()
             ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1'));
@@ -627,9 +622,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg
         parent::moveContentAndCopyDraftPage();
         $this->assertAssertionDataSet('moveContentAndCopyDraftPage');
 
-        $responseSectionsLive = $this->getFrontendResponse($this->recordIds['copiedPageId'])->getResponseSections();
-        $this->assertThat($responseSectionsLive, $this->getRequestSectionDoesNotHaveRecordConstraint()
-            ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #0', 'Regular Element #2'));
+        $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']);
+        $this->assertContains('Reason: ID was not an accessible page', $resultLive['stdout']);
         $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections();
         $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint()
             ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2'));