当前位置: 首页>>代码示例>>PHP>>正文


PHP Factory::attributesFor方法代码示例

本文整理汇总了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);
 }
开发者ID:woolensculpture,项目名称:pulse,代码行数:8,代码来源:AlbumReviewControllerTest.php

示例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');
 }
开发者ID:woolensculpture,项目名称:pulse,代码行数:8,代码来源:ShowControllerTest.php

示例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');
 }
开发者ID:woolensculpture,项目名称:pulse,代码行数:9,代码来源:DJControllerTest.php

示例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');
 }
开发者ID:woolensculpture,项目名称:pulse,代码行数:7,代码来源:EventControllerTest.php

示例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');
 }
开发者ID:woolensculpture,项目名称:pulse,代码行数:7,代码来源:VideoControllerTest.php

示例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');
 }
开发者ID:Rotron,项目名称:laravel5-shop,代码行数:5,代码来源:FactoryTest.php

示例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');
 }
开发者ID:woolensculpture,项目名称:pulse,代码行数:7,代码来源:EboardControllerTest.php


注:本文中的Laracasts\TestDummy\Factory::attributesFor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。