[TASK] Re-work/simplify copyright header in PHP files - Part 8
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Domain / Repository / BackendUserRepositoryTest.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Tests\Unit\Domain\Repository;
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
17 /**
18 * Test case
19 */
20 class BackendUserRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
21
22 /**
23 * @test
24 */
25 public function initializeObjectSetsRespectStoragePidToFalse() {
26 $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
27 $fixture = new \TYPO3\CMS\Extbase\Domain\Repository\BackendUserGroupRepository($objectManager);
28 $querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
29 $querySettings->expects($this->once())->method('setRespectStoragePage')->with(FALSE);
30 $objectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings')->will($this->returnValue($querySettings));
31 $fixture->initializeObject();
32 }
33
34 /**
35 * @test
36 */
37 public function initializeObjectSetsDefaultQuerySettings() {
38 $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
39 /** @var $fixture \TYPO3\CMS\Extbase\Domain\Repository\BackendUserGroupRepository */
40 $fixture = $this->getMock('TYPO3\\CMS\\Extbase\\Domain\\Repository\\BackendUserGroupRepository', array('setDefaultQuerySettings'), array($objectManager));
41 $querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
42 $objectManager->expects($this->once())->method('get')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings')->will($this->returnValue($querySettings));
43 $fixture->expects($this->once())->method('setDefaultQuerySettings')->with($querySettings);
44 $fixture->initializeObject();
45 }
46 }