public function testSettingLoginAttribute() { $originalAttribute = User::getLoginAttribute(); User::setLoginAttribute('foo'); $this->assertEquals('foo', User::getLoginAttribute()); user::setLoginAttribute($originalAttribute); }