本文整理汇总了PHP中UserProfile::get方法的典型用法代码示例。如果您正苦于以下问题:PHP UserProfile::get方法的具体用法?PHP UserProfile::get怎么用?PHP UserProfile::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserProfile
的用法示例。
在下文中一共展示了UserProfile::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUserDeletesProfile
public function testUserDeletesProfile()
{
$user = User::getUserByName('qwerty');
$user->delete();
$this->assertNull(UserProfile::get('qwerty'));
}
示例2: show
public function show($username)
{
$profile = UserProfile::get($username);
if ($profile)
{
$this->profile = $profile;
$this->render('profile/show');
}
else
{
$this->error(t('Profile not found'));
$this->notfound();
}
}
示例3: testUpdate
public function testUpdate()
{
$this->login('azerty');
$this->request('user/profile/update', array(
'firstName' => 'Keyboard',
'lastName' => 'layout',
'birthDate' => '1900-04-28',
'biography' => 'My Bio'));
$this->assertRedirected('user/profile/show/azerty');
$this->assertFlashNotice('Profile updated');
$profile = UserProfile::get('azerty');
$this->assertEquals('Keyboard', $profile->firstName);
$this->assertEquals('layout', $profile->lastName);
$this->assertEquals('1900-04-28', date('Y-m-d', $profile->birthDate));
$this->assertEquals('My Bio', $profile->biography);
}