TYPO3 CMS  TYPO3_7-6
EnableFieldsTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 
23 {
24  const TABLE_Blog = 'tx_blogexample_domain_model_blog';
25 
29  protected $testExtensionsToLoad = ['typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example'];
30 
34  protected $coreExtensionsToLoad = ['sv', 'extbase', 'fluid'];
35 
39  protected function setUp()
40  {
41  parent::setUp();
42 
43  $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/pages.xml');
44  $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_groups.xml');
45  $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_users.xml');
46  $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs-with-fe_groups.xml');
47 
48  $this->setUpFrontendRootPage(1, ['typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/Frontend/JsonRenderer.ts']);
49  }
50 
55  {
56  $responseSections = $this->getFrontendResponse(1)->getResponseSections('Extbase:list()');
57  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
58  ->setTable(self::TABLE_Blog)->setField('title')->setValues('Blog1'));
59  }
60 
65  {
66  $responseSections = $this->getFrontendResponse(1, 0, 0, 0, true, 1)->getResponseSections('Extbase:list()');
67  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
68  ->setTable(self::TABLE_Blog)->setField('title')->setValues('Blog1', 'Blog2'));
69  }
70 
75  {
76  $responseSections = $this->getFrontendResponse(1, 0, 0, 0, true, 2)->getResponseSections('Extbase:list()');
77  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
78  ->setTable(self::TABLE_Blog)->setField('title')->setValues('Blog1', 'Blog3'));
79  }
80 
85  {
86  // first request to fill the query cache
87  $responseSections = $this->getFrontendResponse(1, 0, 0, 0, true, 1)->getResponseSections('Extbase:list()');
88  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
89  ->setTable(self::TABLE_Blog)->setField('title')->setValues('Blog1', 'Blog2'));
90 
91  // second request with other frontenduser
92  $responseSections = $this->getFrontendResponse(1, 0, 0, 0, true, 2)->getResponseSections('Extbase:list()');
93  $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint()
94  ->setTable(self::TABLE_Blog)->setField('title')->setValues('Blog1', 'Blog3'));
95  }
96 }
getFrontendResponse($pageId, $languageId=0, $backendUserId=0, $workspaceId=0, $failOnFailure=true, $frontendUserId=0)
setUpFrontendRootPage($pageId, array $typoScriptFiles=[])