/** * @covers SpoofUser::update */ public function testUpdate() { $user = User::newFromName('MyNewUserName'); $user->addToDatabase(); $s = new SpoofUser('MyNewUserName'); $s->update('BAZFOO'); $this->assertArrayEquals(array('MyNewUserName'), $s->getConflicts()); $foobaz = new SpoofUser('BAZFOO'); $this->assertArrayEquals(array('BazF00', 'BazFoo'), $foobaz->getConflicts()); }
/** * On rename, remove the old entry and add the new * (After a sucessful user rename) * * @param $uid * @param $oldName string * @param $newName string * @return bool */ public static function asAddRenameUserHook($uid, $oldName, $newName) { $spoof = new SpoofUser($newName); $spoof->update($oldName); return true; }