[!!!][TASK] Drop "documentation" extension
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Tests / Functional / Page / PageRepositoryTest.php
index e4662c1..b24b527 100644 (file)
@@ -23,7 +23,7 @@ use TYPO3\CMS\Frontend\Page\PageRepositoryGetPageHookInterface;
 /**
  * Test case
  */
-class PageRepositoryTest extends \TYPO3\Components\TestingFramework\Core\FunctionalTestCase
+class PageRepositoryTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
 {
     protected $coreExtensionsToLoad = ['frontend'];
 
@@ -310,7 +310,6 @@ class PageRepositoryTest extends \TYPO3\Components\TestingFramework\Core\Functio
      */
     public function initSetsPublicPropertyCorrectlyForWorkspacePreview()
     {
-        $this->pageRepo->versioningPreview = true;
         $this->pageRepo->versioningWorkspaceId = 2;
         $this->pageRepo->init(false);
 
@@ -333,7 +332,6 @@ class PageRepositoryTest extends \TYPO3\Components\TestingFramework\Core\Functio
     {
         $GLOBALS['SIM_ACCESS_TIME'] = 123;
 
-        $this->pageRepo->versioningPreview = false;
         $this->pageRepo->versioningWorkspaceId = 0;
         $this->pageRepo->init(false);
 
@@ -358,38 +356,21 @@ class PageRepositoryTest extends \TYPO3\Components\TestingFramework\Core\Functio
     /**
      * @test
      */
-    public function noPagesFromWorkspaceAreShownLive()
-    {
-        // initialization
-        $wsid = 987654321;
-
-        // simulate calls from \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->fetch_the_id()
-        $this->pageRepo->versioningPreview = false;
-        $this->pageRepo->versioningWorkspaceId = $wsid;
-        $this->pageRepo->init(false);
-
-        $this->assertSame([], $this->pageRepo->getPage(11));
-    }
-
-    /**
-     * @test
-     */
     public function previewShowsPagesFromLiveAndCurrentWorkspace()
     {
         // initialization
         $wsid = 987654321;
 
         // simulate calls from \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->fetch_the_id()
-        $this->pageRepo->versioningPreview = true;
         $this->pageRepo->versioningWorkspaceId = $wsid;
         $this->pageRepo->init(false);
 
         $pageRec = $this->pageRepo->getPage(11);
 
-        $this->assertSame(11, $pageRec['uid']);
-        $this->assertSame(11, $pageRec['t3ver_oid']);
-        $this->assertSame(987654321, $pageRec['t3ver_wsid']);
-        $this->assertSame(-1, $pageRec['t3ver_state']);
+        $this->assertEquals(11, $pageRec['uid']);
+        $this->assertEquals(11, $pageRec['t3ver_oid']);
+        $this->assertEquals(987654321, $pageRec['t3ver_wsid']);
+        $this->assertEquals(-1, $pageRec['t3ver_state']);
         $this->assertSame('First draft version', $pageRec['t3ver_label']);
     }
 
@@ -402,16 +383,15 @@ class PageRepositoryTest extends \TYPO3\Components\TestingFramework\Core\Functio
         $wsid = 987654321;
 
         // simulate calls from \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->fetch_the_id()
-        $this->pageRepo->versioningPreview = true;
         $this->pageRepo->versioningWorkspaceId = $wsid;
         $this->pageRepo->init(false);
 
         $pageRec = $this->pageRepo->getWorkspaceVersionOfRecord($wsid, 'pages', 11);
 
-        $this->assertSame(12, $pageRec['uid']);
-        $this->assertSame(11, $pageRec['t3ver_oid']);
-        $this->assertSame(987654321, $pageRec['t3ver_wsid']);
-        $this->assertSame(-1, $pageRec['t3ver_state']);
+        $this->assertEquals(12, $pageRec['uid']);
+        $this->assertEquals(11, $pageRec['t3ver_oid']);
+        $this->assertEquals(987654321, $pageRec['t3ver_wsid']);
+        $this->assertEquals(-1, $pageRec['t3ver_state']);
         $this->assertSame('First draft version', $pageRec['t3ver_label']);
     }
 
@@ -431,7 +411,7 @@ class PageRepositoryTest extends \TYPO3\Components\TestingFramework\Core\Functio
             ]
         ];
 
-        $this->pageRepo->versioningPreview = false;
+        $this->pageRepo->versioningWorkspaceId = 0;
         $this->pageRepo->init(false);
 
         $conditions = $this->pageRepo->enableFields($table);
@@ -461,7 +441,7 @@ class PageRepositoryTest extends \TYPO3\Components\TestingFramework\Core\Functio
             ]
         ];
 
-        $this->pageRepo->versioningPreview = true;
+        $this->pageRepo->versioningWorkspaceId = 13;
         $this->pageRepo->init(false);
 
         $conditions = $this->pageRepo->enableFields($table);
@@ -491,7 +471,6 @@ class PageRepositoryTest extends \TYPO3\Components\TestingFramework\Core\Functio
             ]
         ];
 
-        $this->pageRepo->versioningPreview = true;
         $this->pageRepo->versioningWorkspaceId = 2;
         $this->pageRepo->init(false);
 
@@ -517,7 +496,7 @@ class PageRepositoryTest extends \TYPO3\Components\TestingFramework\Core\Functio
             ]
         ];
 
-        $this->pageRepo->versioningPreview = true;
+        $this->pageRepo->versioningWorkspaceId = 23;
         $this->pageRepo->init(false);
 
         $conditions = $this->pageRepo->enableFields($table, -1, [], true);
@@ -531,7 +510,7 @@ class PageRepositoryTest extends \TYPO3\Components\TestingFramework\Core\Functio
         $this->assertThat(
             $conditions,
             $this->logicalNot($this->stringContains(' AND (' . $connection->quoteIdentifier($table . '.pid') . ' <> -1)')),
-            'No necords from page -1'
+            'No records from page -1'
         );
     }