query("DELETE FROM lu_users WHERE username LIKE '_test_%'"); } public function testUserAdd1() { $ctrl = static::getCtrl(); $newUser = new LuUsersAddDbo(); $newUser->setUsername("_test_user1"); $newUser->setPassword("test42"); $newUser->setFirstname("Test"); $newUser->setLastname("user1"); $newUser->setEmail("test.user1@example.com"); $newUser->setExternalAuth(null); $newUser->setProfileId(null); $user = $ctrl->add($newUser); $this->assertNotNull($user); $this->assertNotNull($user->getId()); $this->assertSame($user->getUsername(), "_test_user1"); $this->assertSame($user->getFirstname(), "Test"); $this->assertSame($user->getLastname(), "user1"); $this->assertSame($user->getEmail(), "test.user1@example.com"); $this->assertNull($user->getExternalAuth()); $this->assertNull($user->getProfileId()); } }