當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。