本文整理汇总了PHP中Laracasts\TestDummy\Factory::attributesFor方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::attributesFor方法的具体用法?PHP Factory::attributesFor怎么用?PHP Factory::attributesFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Laracasts\TestDummy\Factory
的用法示例。
在下文中一共展示了Factory::attributesFor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: it_validates_a_album_review_edit_request
/** @test */
public function it_validates_a_album_review_edit_request()
{
$album = TestDummy::create('WITR\\AlbumReview');
$form = TestDummy::attributesFor('WITR\\AlbumReview', ['band_name' => '', 'album_name' => '', 'review' => '', 'img_name' => __DIR__ . '/files/test.html']);
$this->beEditor();
$this->visit('/admin/reviews/' . $album->id)->onPage('/admin/reviews/' . $album->id)->submitForm('Update Review', $form)->andSee('The artist field is required')->andSee('The album field is required')->andSee('The review field is required')->andSee('The album cover should be an image')->onPage('/admin/reviews/' . $album->id);
}
示例2: it_validates_a_create_request
/** @test */
public function it_validates_a_create_request()
{
$form = TestDummy::attributesFor('WITR\\Show', ['slider_picture' => __DIR__ . '/files/non-slider_picture.jpg', 'show_picture' => __DIR__ . '/files/non-show_picture.jpg', 'name' => '']);
unset($form['active']);
$this->beAdmin();
$this->visit('/admin/shows/create')->onPage('/admin/shows/create')->submitForm('Save Show', $form)->andSee('The name field is required')->andSee('The slider picture must be 670 pixels wide and 344 pixels tall')->andSee('The show picture must be 150 pixels wide and 150 pixels tall')->onPage('/admin/shows/create');
}
示例3: it_validates_a_create_request
/** @test */
public function it_validates_a_create_request()
{
$form = TestDummy::attributesFor('WITR\\DJ', ['picture' => __DIR__ . '/files/non-dj.pdf', 'name' => '', 'realname' => '']);
unset($form['updated_at']);
unset($form['created_at']);
$this->beAdmin();
$this->visit('/admin/djs/create')->onPage('/admin/djs/create')->submitForm('Save DJ', $form)->andSee('The name field is required')->andSee('The realname field is required')->andSee('The picture must be an image')->onPage('/admin/djs/create');
}
示例4: it_validates_a_create_request
/** @test */
public function it_validates_a_create_request()
{
$form = TestDummy::attributesFor('WITR\\Event', ['picture' => __DIR__ . '/files/non-event.jpg', 'date' => '']);
$this->beAdmin();
$this->visit('/admin/events/create')->onPage('/admin/events/create')->submitForm('Save Event', $form)->andSee('The date field is required')->andSee('The picture must be 670 pixels wide and 344 pixels tall')->onPage('/admin/events/create');
}
示例5: it_validates_a_video_review_create_request
/** @test */
public function it_validates_a_video_review_create_request()
{
$form = TestDummy::attributesFor('WITR\\Video', ['artist' => '', 'song' => '', 'album' => '', 'review' => '', 'url_tag' => '']);
$this->beEditor();
$this->visit('/admin/videos/create')->onPage('/admin/videos/create')->submitForm('Save Review', $form)->andSee('The artist field is required')->andSee('The song field is required')->andSee('The album field is required')->andSee('The review field is required')->andSee('The YouTube URL is required')->onPage('/admin/videos/create');
}
示例6: it_does_not_look_for_existing_global_functions_when_using_short_names
/** @test */
public function it_does_not_look_for_existing_global_functions_when_using_short_names()
{
TestDummy::attributesFor('comment');
}
示例7: it_validates_a_create_request
/** @test */
public function it_validates_a_create_request()
{
$form = TestDummy::attributesFor('WITR\\Eboard', ['position' => '']);
$this->beAdmin();
$this->visit('/admin/eboard/create')->onPage('/admin/eboard/create')->submitForm('Save Position', $form)->andSee('The position field is required')->onPage('/admin/eboard/create');
}