‪TYPO3CMS  9.5
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 = ['core', 'extbase', 'fluid'];
35 
39  protected function ‪setUp()
40  {
41  parent::setUp();
42 
43  $this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/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.typoscript']);
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 }
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\EnableFieldsTest\TABLE_Blog
‪const TABLE_Blog
Definition: EnableFieldsTest.php:24
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\getRequestSectionHasRecordConstraint
‪HasRecordConstraint getRequestSectionHasRecordConstraint()
Definition: AbstractDataHandlerActionTestCase.php:174
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\EnableFieldsTest\onlyReturnProtectedRecordsForTheSecondUserGroup
‪onlyReturnProtectedRecordsForTheSecondUserGroup()
Definition: EnableFieldsTest.php:72
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\EnableFieldsTest\onlyReturnProtectedRecordsForTheFirstUserGroup
‪onlyReturnProtectedRecordsForTheFirstUserGroup()
Definition: EnableFieldsTest.php:62
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\EnableFieldsTest\setUp
‪setUp()
Definition: EnableFieldsTest.php:37
‪TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase
Definition: AbstractDataHandlerActionTestCase.php:33
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\EnableFieldsTest\protectedRecordsNotFoundIfNoUserLoggedIn
‪protectedRecordsNotFoundIfNoUserLoggedIn()
Definition: EnableFieldsTest.php:52
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\EnableFieldsTest
Definition: EnableFieldsTest.php:23
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence
Definition: AddTest.php:2
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\EnableFieldsTest\$testExtensionsToLoad
‪array $testExtensionsToLoad
Definition: EnableFieldsTest.php:28
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\EnableFieldsTest\onlyOwnProtectedRecordsWithQueryCacheInvolvedAreReturned
‪onlyOwnProtectedRecordsWithQueryCacheInvolvedAreReturned()
Definition: EnableFieldsTest.php:82
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\EnableFieldsTest\$coreExtensionsToLoad
‪array $coreExtensionsToLoad
Definition: EnableFieldsTest.php:32