本文整理汇总了PHP中app\models\Profile::first方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::first方法的具体用法?PHP Profile::first怎么用?PHP Profile::first使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Profile
的用法示例。
在下文中一共展示了Profile::first方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testProfileNonEmptySkillsMatrix
/**
* Checks that skills/stars/flags are correct
*
* (Have to decide an ordering here - probably alphabetical on skill name, case-insensitive)
*/
public function testProfileNonEmptySkillsMatrix()
{
$faker = Faker\Factory::create();
factory(App\Models\Profile::class, 'withAUser', 1)->create();
factory(App\Models\Tag::class, 3)->create();
$profile = App\Models\Profile::first();
$rating = 5;
foreach (App\Models\Tag::all() as $tag) {
$seeking = $faker->boolean;
$offering = $faker->boolean;
$profile->add_tag($tag, $rating, $seeking, $offering);
$tags[] = [$tag->name, $rating, $seeking, $offering];
$rating = $rating - 1;
}
$this->visit(route('profile.view', ['name' => $profile->user->username]))->see('seeInElement', '.rating:nth-child(1)', 6)->see('seeInElement', '.rating:nth-child(2)', 4)->see('seeInElement', '.rating:nth-child(3)', 2);
}