[TASK] Namespace classes
[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 * Copyright notice
6 *
7 * (c) 2012 Felix Kopp <felix-source@phorax.com>
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26 /**
27 * Testcase for Tx_Extbase_Domain_Repository_BackendUserRepository.
28 *
29 * @author Markus G√ľnther <mail@markus-guenther.de>
30 * @author Oliver Klee <typo3-coding@oliverklee.de>
31 * @package Extbase
32 * @subpackage Domain\Repository
33 * @api
34 */
35 class BackendUserRepositoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
36
37 /**
38 * @test
39 */
40 public function initializeObjectSetsRespectStoragePidToFalse() {
41 $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
42 $fixture = new \TYPO3\CMS\Extbase\Domain\Repository\BackendUserGroupRepository($objectManager);
43 $querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
44 $querySettings->expects($this->once())->method('setRespectStoragePage')->with(FALSE);
45 $objectManager->expects($this->once())->method('create')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings')->will($this->returnValue($querySettings));
46 $fixture->initializeObject();
47 }
48
49 /**
50 * @test
51 */
52 public function initializeObjectSetsDefaultQuerySettings() {
53 $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface');
54 /** @var $fixture \TYPO3\CMS\Extbase\Domain\Repository\BackendUserGroupRepository */
55 $fixture = $this->getMock('TYPO3\\CMS\\Extbase\\Domain\\Repository\\BackendUserGroupRepository', array('setDefaultQuerySettings'), array($objectManager));
56 $querySettings = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
57 $objectManager->expects($this->once())->method('create')->with('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings')->will($this->returnValue($querySettings));
58 $fixture->expects($this->once())->method('setDefaultQuerySettings')->with($querySettings);
59 $fixture->initializeObject();
60 }
61
62 }
63
64
65 ?>