[FEATURE] Add a BackendUser model
authorMarkus Günther <mail@markus-guenther.de>
Sat, 21 Jul 2012 16:34:24 +0000 (18:34 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 1 Aug 2012 10:13:18 +0000 (12:13 +0200)
Some extensions in the TYPO3 backend use backend users. The belog and
the beuser module are based on extbase and it will be useful if not
every extension has to implement an own backendUser model.

This patch adds a backend user model to extbase.

Change-Id: I84e8ea528c5f91151369f59db6a00acb0174544b
Resolves: #39145
Releases: 6.0
Reviewed-on: http://review.typo3.org/12981
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
Reviewed-by: Oliver Klee
Tested-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/extbase/Classes/Domain/Model/BackendUser.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Domain/Repository/BackendUserRepository.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Domain/Model/BackendUserTest.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Domain/Repository/BackendUserRepositoryTest.php [new file with mode: 0644]
typo3/sysext/extbase/ext_typoscript_setup.txt

diff --git a/typo3/sysext/extbase/Classes/Domain/Model/BackendUser.php b/typo3/sysext/extbase/Classes/Domain/Model/BackendUser.php
new file mode 100644 (file)
index 0000000..147567a
--- /dev/null
@@ -0,0 +1,307 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * This model represents a back-end user.
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @author Oliver Klee <typo3-coding@oliverklee.de>
+ *
+ * @package Extbase
+ * @subpackage Domain\Model
+ *
+ * @scope prototype
+ * @entity
+ * @api
+ */
+class Tx_Extbase_Domain_Model_BackendUser extends Tx_Extbase_DomainObject_AbstractEntity {
+
+       /**
+        * @var string
+        * @validate notEmpty
+        */
+       protected $userName = '';
+
+       /**
+        * @var boolean
+        */
+       protected $isAdministrator = FALSE;
+
+       /**
+        * @var boolean
+        */
+       protected $isDisabled = FALSE;
+
+       /**
+        * @var DateTime|NULL
+        */
+       protected $startDateAndTime = NULL;
+
+       /**
+        * @var DateTime|NULL
+        */
+       protected $endDateAndTime = NULL;
+
+       /**
+        * @var string
+        */
+       protected $email = '';
+
+       /**
+        * @var string
+        */
+       protected $realName = '';
+
+       /**
+        * @var DateTime|NULL
+        */
+       protected $lastloginDateAndTime;
+
+       /**
+        * @var boolean
+        */
+       protected $ipLockIsDisabled = FALSE;
+
+       /**
+        * Gets the user name.
+        *
+        * @return string the user name, will not be empty
+        */
+       public function getUserName() {
+               return $this->userName;
+       }
+
+       /**
+        * Sets the user name.
+        *
+        * @param string $userName the user name to set, must not be empty
+        *
+        * @return void
+        */
+       public function setUserName($userName) {
+               $this->userName = $userName;
+       }
+
+       /**
+        * Checks whether this user is an administrator.
+        *
+        * @return boolean whether this user is an administrator
+        */
+       public function getIsAdministrator() {
+               return $this->isAdministrator;
+       }
+
+       /**
+        * Sets whether this user should be an administrator.
+        *
+        * @param boolean $isAdministrator whether this user should be an administrator
+        *
+        * @return void
+        */
+       public function setIsAdministrator($isAdministrator) {
+               $this->isAdministrator = $isAdministrator;
+       }
+
+       /**
+        * Checks whether this user is disabled.
+        *
+        * @return boolean whether this user is disabled
+        */
+       public function getIsDisabled() {
+               return $this->isDisabled;
+       }
+
+       /**
+        * Sets whether this user is disabled.
+        *
+        * @param boolean $isDisabled whether this user is disabled
+        *
+        * @return void
+        */
+       public function setIsDisabled($isDisabled) {
+               $this->isDisabled = $isDisabled;
+       }
+
+       /**
+        * Returns the point in time from which this user is enabled.
+        *
+        * @return \DateTime|NULL the start date and time
+        */
+       public function getStartDateAndTime() {
+               return $this->startDateAndTime;
+       }
+
+       /**
+        * Sets the point in time from which this user is enabled.
+        *
+        * @param \DateTime|NULL $dateAndTime the start date and time
+        *
+        * @return void
+        */
+       public function setStartDateAndTime(\DateTime $dateAndTime = NULL) {
+               $this->startDateAndTime = $dateAndTime;
+       }
+
+       /**
+        * Returns the point in time before which this user is enabled.
+        *
+        * @return \DateTime|NULL the end date and time
+        */
+       public function getEndDateAndTime() {
+               return $this->endDateAndTime;
+       }
+
+       /**
+        * Sets the point in time before which this user is enabled.
+        *
+        * @param \DateTime|NULL $dateAndTime the end date and time
+        *
+        * @return void
+        */
+       public function setEndDateAndTime(\DateTime $dateAndTime = NULL) {
+               $this->endDateAndTime = $dateAndTime;
+       }
+
+       /**
+        * Gets the e-mail address of this user.
+        *
+        * @return string the e-mail address, might be empty
+        */
+       public function getEmail() {
+               return $this->email;
+       }
+
+       /**
+        * Sets the e-mail address of this user.
+        *
+        * @param string $email the e-mail address, may be empty
+        *
+        * @return void
+        */
+       public function setEmail($email) {
+               $this->email = $email;
+       }
+
+       /**
+        * Returns this user's real name.
+        *
+        * @return string the real name. might be empty
+        */
+       public function getRealName() {
+               return $this->realName;
+       }
+
+       /**
+        * Sets this user's real name.
+        *
+        * @param string $name the user's real name, may be empty.
+        */
+       public function setRealName($name) {
+               $this->realName = $name;
+       }
+
+       /**
+        * Checks whether this user is currently activated.
+        *
+        * This function takes the "disabled" flag, the start date/time and the end date/time into account.
+        *
+        * @return boolean whether this user is currently activated
+        */
+       public function isActivated() {
+               return !$this->getIsDisabled() && $this->isActivatedViaStartDateAndTime() && $this->isActivatedViaEndDateAndTime();
+       }
+
+       /**
+        * Checks whether this user is activated as far as the start date and time is concerned.
+        *
+        * @return boolean whether this user is activated as far as the start date and time is concerned
+        */
+       protected function isActivatedViaStartDateAndTime() {
+               if ($this->getStartDateAndTime() === NULL) {
+                       return TRUE;
+               }
+
+               $now = new \DateTime('now');
+
+               return ($this->getStartDateAndTime() <= $now);
+       }
+
+       /**
+        * Checks whether this user is activated as far as the end date and time is concerned.
+        *
+        * @return boolean whether this user is activated as far as the end date and time is concerned
+        */
+       protected function isActivatedViaEndDateAndTime() {
+               if ($this->getEndDateAndTime() === NULL) {
+                       return TRUE;
+               }
+
+               $now = new \DateTime('now');
+
+               return ($now <= $this->getEndDateAndTime());
+       }
+
+       /**
+        * Sets whether the IP lock for this user is disabled.
+        *
+        * @param boolean $disableIpLock whether the IP lock for this user is disabled
+        *
+        * @return void
+        */
+       public function setIpLockIsDisabled($disableIpLock) {
+               $this->ipLockIsDisabled = $disableIpLock;
+       }
+
+       /**
+        * Checks whether the IP lock for this user is disabled.
+        *
+        * @return boolean whether the IP lock for this user is disabled
+        */
+       public function getIpLockIsDisabled() {
+               return $this->ipLockIsDisabled;
+       }
+
+       /**
+        * Gets this user's last login date and time.
+        *
+        * @return \DateTime|NULL this user's last login date and time, will be NULL if this user has never logged in before
+        */
+       public function getLastLoginDateAndTime() {
+               return $this->lastloginDateAndTime;
+       }
+
+       /**
+        * Sets this user's last login date and time.
+        *
+        * @param \DateTime|NULL $dateAndTime this user's last login date and time
+        *
+        * @return void
+        */
+       public function setLastLoginDateAndTime(\DateTime $dateAndTime = NULL) {
+               $this->lastloginDateAndTime = $dateAndTime;
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Domain/Repository/BackendUserRepository.php b/typo3/sysext/extbase/Classes/Domain/Repository/BackendUserRepository.php
new file mode 100644 (file)
index 0000000..91161c0
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Markus Günther <mail@markus-guenther.de>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Repository for Tx_Extbase_Domain_Model_BackendUser.
+ *
+ * @author Markus Günther <mail@markus-guenther.de>
+ * @author Oliver Klee <typo3-coding@oliverklee.de>
+ *
+ * @package Extbase
+ * @subpackage Domain\Repository
+ * @api
+ */
+class Tx_Extbase_Domain_Repository_BackendUserRepository extends Tx_Extbase_Persistence_Repository {
+
+       /**
+        * Initializes the repository.
+        *
+        * @return void
+        */
+       public function initializeObject() {
+               /** @var $querySettings Tx_Extbase_Persistence_Typo3QuerySettings */
+               $querySettings = $this->objectManager->create('Tx_Extbase_Persistence_Typo3QuerySettings');
+               $querySettings->setRespectStoragePage(FALSE);
+               $this->setDefaultQuerySettings($querySettings);
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Tests/Unit/Domain/Model/BackendUserTest.php b/typo3/sysext/extbase/Tests/Unit/Domain/Model/BackendUserTest.php
new file mode 100644 (file)
index 0000000..0c5d47d
--- /dev/null
@@ -0,0 +1,359 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Felix Kopp <felix-source@phorax.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Testcase for Tx_Extbase_Domain_Model_BackendUser.
+ *
+ * @author Felix Kopp <felix-source@phorax.com>
+ * @author Oliver Klee <typo3-coding@oliverklee.de>
+ *
+ * @package Extbase
+ * @subpackage Domain\Model
+ *
+ * @scope prototype
+ * @entity
+ * @api
+ */
+class Tx_Extbase_Tests_Unit_Domain_Model_BackendUserTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
+
+       /**
+        * @var Tx_Extbase_Domain_Model_BackendUser
+        */
+       protected $fixture = NULL;
+
+       public function setUp() {
+               $this->fixture = new Tx_Extbase_Domain_Model_BackendUser();
+       }
+
+       public function tearDown() {
+               unset($this->fixture);
+       }
+
+       /**
+        * @test
+        */
+       public function getUserNameInitiallyReturnsEmptyString() {
+               $this->assertSame(
+                       '',
+                       $this->fixture->getUserName()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function setUserNameSetsUserName() {
+               $userName = 'don.juan';
+               $this->fixture->setUserName($userName);
+
+               $this->assertSame(
+                       $userName,
+                       $this->fixture->getUserName()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function getIsAdministratorInitiallyReturnsFalse() {
+               $this->assertFalse(
+                       $this->fixture->getIsAdministrator()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function setIsAdministratorCanSetIsAdministratorToTrue() {
+               $this->fixture->setIsAdministrator(TRUE);
+
+               $this->assertTrue(
+                       $this->fixture->getIsAdministrator()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function getIsDisabledInitiallyReturnsFalse() {
+               $this->assertFalse(
+                       $this->fixture->getIsDisabled()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function setIsDisabledCanSetIsDisabledToTrue() {
+               $this->fixture->setIsDisabled(TRUE);
+
+               $this->assertTrue(
+                       $this->fixture->getIsDisabled()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function getStartDateAndTimeInitiallyReturnsNull() {
+               $this->assertNull(
+                       $this->fixture->getStartDateAndTime()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function setStartDateAndTimeSetsStartDateAndTime() {
+               $date = new \DateTime();
+               $this->fixture->setStartDateAndTime($date);
+
+               $this->assertSame(
+                       $date,
+                       $this->fixture->getStartDateAndTime()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function getEndDateAndTimeInitiallyReturnsNull() {
+               $this->assertNull(
+                       $this->fixture->getEndDateAndTime()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function setEndDateAndTimeSetsEndDateAndTime() {
+               $date = new \DateTime();
+               $this->fixture->setEndDateAndTime($date);
+
+               $this->assertSame(
+                       $date,
+                       $this->fixture->getEndDateAndTime()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function isActivatedInitiallyReturnsTrue() {
+               $this->assertTrue(
+                       $this->fixture->isActivated()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function isActivatedForDisabledReturnsFalse() {
+               $this->fixture->setIsDisabled(TRUE);
+
+               $this->assertFalse(
+                       $this->fixture->isActivated()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function isActivatedForStartDateAndTimeInFutureReturnsFalse() {
+               $tomorrow = new \DateTime('tomorrow');
+               $this->fixture->setStartDateAndTime($tomorrow);
+
+               $this->assertFalse(
+                       $this->fixture->isActivated()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function isActivatedForStartDateAndTimeInPastReturnsTrue() {
+               $yesterday = new \DateTime('yesterday');
+               $this->fixture->setStartDateAndTime($yesterday);
+
+               $this->assertTrue(
+                       $this->fixture->isActivated()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function isActivatedForEndDateAndTimeInFutureReturnsTrue() {
+               $tomorrow = new \DateTime('tomorrow');
+               $this->fixture->setEndDateAndTime($tomorrow);
+
+               $this->assertTrue(
+                       $this->fixture->isActivated()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function isActivatedForEndDateAndTimeInPastReturnsFalse() {
+               $yesterday = new \DateTime('yesterday');
+               $this->fixture->setEndDateAndTime($yesterday);
+
+               $this->assertFalse(
+                       $this->fixture->isActivated()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function isActivatedForStartDateAndTimeInPastEndDateAndTimeInFutureReturnsTrue() {
+               $yesterday = new \DateTime('yesterday');
+               $this->fixture->setStartDateAndTime($yesterday);
+
+               $tomorrow = new \DateTime('tomorrow');
+               $this->fixture->setEndDateAndTime($tomorrow);
+
+               $this->assertTrue(
+                       $this->fixture->isActivated()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function isActivatedForStartDateAndTimeInPastEndDateAndTimeInPastReturnsFalse() {
+               $yesterday = new \DateTime('yesterday');
+               $this->fixture->setStartDateAndTime($yesterday);
+               $this->fixture->setEndDateAndTime($yesterday);
+
+               $this->assertFalse(
+                       $this->fixture->isActivated()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function isActivatedForStartDateAndTimeInFutureEndDateAndTimeInFutureReturnsFalse() {
+               $tomorrow = new \DateTime('tomorrow');
+               $this->fixture->setStartDateAndTime($tomorrow);
+               $this->fixture->setEndDateAndTime($tomorrow);
+
+               $this->assertFalse(
+                       $this->fixture->isActivated()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function getEmailInitiallyReturnsEmptyString() {
+               $this->assertSame(
+                       '',
+                       $this->fixture->getEmail()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function setEmailSetsEmail() {
+               $email = 'don.juan@example.com';
+               $this->fixture->setEmail($email);
+
+               $this->assertSame(
+                       $email,
+                       $this->fixture->getEmail()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function getRealNameInitiallyReturnsEmptyString() {
+               $this->assertSame(
+                       '',
+                       $this->fixture->getRealName()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function setRealNameSetsRealName() {
+               $realName = 'Don Juan';
+               $this->fixture->setRealName($realName);
+
+               $this->assertSame(
+                       $realName,
+                       $this->fixture->getRealName()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function getIpLockIsDisabledInitiallyReturnsFalse() {
+               $this->assertFalse(
+                       $this->fixture->getIpLockIsDisabled()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function setIpLockIsDisabledCanSetIpLockIsDisabledToTrue() {
+               $this->fixture->setIpLockIsDisabled(TRUE);
+
+               $this->assertTrue(
+                       $this->fixture->getIpLockIsDisabled()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function getLastLoginDateAndTimeInitiallyReturnsNull() {
+               $this->assertNull(
+                       $this->fixture->getLastLoginDateAndTime()
+               );
+       }
+
+       /**
+        * @test
+        */
+       public function setLastLoginDateAndTimeSetsLastLoginDateAndTime() {
+               $date = new \DateTime();
+               $this->fixture->setLastLoginDateAndTime($date);
+
+               $this->assertSame(
+                       $date,
+                       $this->fixture->getLastLoginDateAndTime()
+               );
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Tests/Unit/Domain/Repository/BackendUserRepositoryTest.php b/typo3/sysext/extbase/Tests/Unit/Domain/Repository/BackendUserRepositoryTest.php
new file mode 100644 (file)
index 0000000..1adb006
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2012 Felix Kopp <felix-source@phorax.com>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Testcase for Tx_Extbase_Domain_Repository_BackendUserRepository.
+ *
+ * @author Markus Günther <mail@markus-guenther.de>
+ * @author Oliver Klee <typo3-coding@oliverklee.de>
+ *
+ * @package Extbase
+ * @subpackage Domain\Repository
+ * @api
+ */
+class Tx_Extbase_Tests_Unit_Domain_Repository_BackendUserRepositoryTest extends Tx_Extbase_Tests_Unit_BaseTestCase {
+
+       /**
+        * @test
+        */
+       public function initializeObjectSetsRespectStoragePidToFalse() {
+               $objectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
+               $fixture = new Tx_Extbase_Domain_Repository_BackendUserRepository($objectManager);
+
+               $querySettings = $this->getMock('Tx_Extbase_Persistence_Typo3QuerySettings');
+               $querySettings->expects($this->once())->method('setRespectStoragePage')->with(FALSE);
+               $objectManager->expects($this->once())->method('create')
+                       ->with('Tx_Extbase_Persistence_Typo3QuerySettings')->will($this->returnValue($querySettings));
+
+               $fixture->initializeObject();
+       }
+
+       /**
+        * @test
+        */
+       public function initializeObjectSetsDefaultQuerySettings() {
+               $objectManager = $this->getMock('Tx_Extbase_Object_ObjectManagerInterface');
+               /** @var $fixture Tx_Extbase_Domain_Repository_BackendUserRepository */
+               $fixture = $this->getMock(
+                       'Tx_Extbase_Domain_Repository_BackendUserRepository',
+                       array('setDefaultQuerySettings'), array($objectManager)
+               );
+
+               $querySettings = $this->getMock('Tx_Extbase_Persistence_Typo3QuerySettings');
+               $objectManager->expects($this->once())->method('create')
+                       ->with('Tx_Extbase_Persistence_Typo3QuerySettings')->will($this->returnValue($querySettings));
+
+               $fixture->expects($this->once())->method('setDefaultQuerySettings')->with($querySettings);
+
+               $fixture->initializeObject();
+       }
+}
+?>
\ No newline at end of file
index 161b61b..15d8518 100644 (file)
@@ -19,6 +19,21 @@ config.tx_extbase {
                enableAutomaticCacheClearing = 1
                updateReferenceIndex = 0
                classes {
+                       Tx_Extbase_Domain_Model_BackendUser {
+                               mapping {
+                                       tableName = be_users
+                                       columns {
+                                               username.mapOnProperty = userName
+                                               admin.mapOnProperty = isAdministrator
+                                               disable.mapOnProperty = isDisabled
+                                               realName.mapOnProperty = realName
+                                               starttime.mapOnProperty = startDateAndTime
+                                               endtime.mapOnProperty = endDateAndTime
+                                               disableIPlock.mapOnProperty = ipLockIsDisabled
+                                               lastlogin.mapOnProperty = lastLoginDateAndTime
+                                       }
+                               }
+                       }
                        Tx_Extbase_Domain_Model_FrontendUser {
                                mapping {
                                        tableName = fe_users