‪TYPO3CMS  10.4
UserRecycleTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 
24 {
30  protected ‪$assertionDataSetDirectory = 'typo3/sysext/recycler/Tests/Functional/Recycle/Pages/DataSet/Assertion/';
31 
35  protected function ‪setUp(): void
36  {
37  parent::setUp();
38  $this->importDataSet(__DIR__ . '/../../Fixtures/Database/pages.xml');
39  // Set up "editor" user
40  $this->setUpBackendUserFromFixture(2);
41  }
42 
46  public function ‪retrieveDeletedPagesNoRecursion()
47  {
48  $deletedPages = $this->‪getDeletedPages(1, 0);
49  $assertData = $this->‪loadDataSet($this->assertionDataSetDirectory . 'deletedPage-3.xml');
50  self::assertCount(1, $deletedPages);
51  self::assertArrayHasKey('pages', $deletedPages);
52  self::assertCount(2, $deletedPages['pages']);
53  self::assertSame($assertData[0]['uid'], $deletedPages[0]['uid']);
54  }
55 
60  {
61  $deletedPages = $this->‪getDeletedPages(1, 1);
62  $assertData = $this->‪loadDataSet($this->assertionDataSetDirectory . 'deletedPage-3_4_5.xml');
63  self::assertCount(1, $deletedPages);
64  self::assertArrayHasKey('pages', $deletedPages);
65  self::assertCount(3, $deletedPages['pages']);
66  self::assertSame($assertData[0]['uid'], $deletedPages[0]['uid']);
67  }
68 
73  {
74  $deletedPages = $this->‪getDeletedPages(6, 0);
75  self::assertCount(0, $deletedPages);
76  }
77 
81  public function ‪canNotRetrieveDeletedWithNoAccess()
82  {
83  $deletedPages = $this->‪getDeletedPages(7, 0);
84  self::assertCount(0, $deletedPages);
85  }
86 }
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\Pages\UserRecycleTest\canNotRetrieveDeletedPagesOutsideWebmount
‪canNotRetrieveDeletedPagesOutsideWebmount()
Definition: UserRecycleTest.php:71
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\AbstractRecycleTestCase\getDeletedPages
‪array getDeletedPages($pageUid, $depth=0)
Definition: AbstractRecycleTestCase.php:56
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\Pages\UserRecycleTest\canNotRetrieveDeletedWithNoAccess
‪canNotRetrieveDeletedWithNoAccess()
Definition: UserRecycleTest.php:80
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\AbstractRecycleTestCase
Definition: AbstractRecycleTestCase.php:27
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\Pages\UserRecycleTest\$assertionDataSetDirectory
‪string $assertionDataSetDirectory
Definition: UserRecycleTest.php:29
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\Pages\UserRecycleTest
Definition: UserRecycleTest.php:24
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\Pages
Definition: AdminRecycleTest.php:16
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\Pages\UserRecycleTest\retrieveDeletedPagesNoRecursion
‪retrieveDeletedPagesNoRecursion()
Definition: UserRecycleTest.php:45
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\Pages\UserRecycleTest\setUp
‪setUp()
Definition: UserRecycleTest.php:34
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\Pages\UserRecycleTest\retrieveDeletedPagesOneLevelRecursion
‪retrieveDeletedPagesOneLevelRecursion()
Definition: UserRecycleTest.php:58
‪TYPO3\CMS\Recycler\Tests\Functional\Recycle\AbstractRecycleTestCase\loadDataSet
‪array loadDataSet($path)
Definition: AbstractRecycleTestCase.php:85