[!!!][TASK] Drop "documentation" extension
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Tests / Functional / Page / PageRepositoryTest.php
index 837326c..b24b527 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Frontend\Tests\Functional\Page;
 
 use Prophecy\Argument;
 use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Tests\FunctionalTestCase;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Frontend\Page\PageRepository;
 use TYPO3\CMS\Frontend\Page\PageRepositoryGetPageHookInterface;
@@ -24,7 +23,7 @@ use TYPO3\CMS\Frontend\Page\PageRepositoryGetPageHookInterface;
 /**
  * Test case
  */
-class PageRepositoryTest extends FunctionalTestCase
+class PageRepositoryTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
 {
     protected $coreExtensionsToLoad = ['frontend'];
 
@@ -311,7 +310,6 @@ class PageRepositoryTest extends FunctionalTestCase
      */
     public function initSetsPublicPropertyCorrectlyForWorkspacePreview()
     {
-        $this->pageRepo->versioningPreview = true;
         $this->pageRepo->versioningWorkspaceId = 2;
         $this->pageRepo->init(false);
 
@@ -334,7 +332,6 @@ class PageRepositoryTest extends FunctionalTestCase
     {
         $GLOBALS['SIM_ACCESS_TIME'] = 123;
 
-        $this->pageRepo->versioningPreview = false;
         $this->pageRepo->versioningWorkspaceId = 0;
         $this->pageRepo->init(false);
 
@@ -359,38 +356,21 @@ class PageRepositoryTest extends FunctionalTestCase
     /**
      * @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']);
     }
 
@@ -403,16 +383,15 @@ class PageRepositoryTest extends FunctionalTestCase
         $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']);
     }
 
@@ -432,7 +411,7 @@ class PageRepositoryTest extends FunctionalTestCase
             ]
         ];
 
-        $this->pageRepo->versioningPreview = false;
+        $this->pageRepo->versioningWorkspaceId = 0;
         $this->pageRepo->init(false);
 
         $conditions = $this->pageRepo->enableFields($table);
@@ -462,7 +441,7 @@ class PageRepositoryTest extends FunctionalTestCase
             ]
         ];
 
-        $this->pageRepo->versioningPreview = true;
+        $this->pageRepo->versioningWorkspaceId = 13;
         $this->pageRepo->init(false);
 
         $conditions = $this->pageRepo->enableFields($table);
@@ -492,7 +471,6 @@ class PageRepositoryTest extends FunctionalTestCase
             ]
         ];
 
-        $this->pageRepo->versioningPreview = true;
         $this->pageRepo->versioningWorkspaceId = 2;
         $this->pageRepo->init(false);
 
@@ -518,7 +496,7 @@ class PageRepositoryTest extends FunctionalTestCase
             ]
         ];
 
-        $this->pageRepo->versioningPreview = true;
+        $this->pageRepo->versioningWorkspaceId = 23;
         $this->pageRepo->init(false);
 
         $conditions = $this->pageRepo->enableFields($table, -1, [], true);
@@ -532,7 +510,7 @@ class PageRepositoryTest extends FunctionalTestCase
         $this->assertThat(
             $conditions,
             $this->logicalNot($this->stringContains(' AND (' . $connection->quoteIdentifier($table . '.pid') . ' <> -1)')),
-            'No necords from page -1'
+            'No records from page -1'
         );
     }