Esempio n. 1
0
 /**
  * @test
  * it should allow using number placeholder when inserting many
  */
 public function it_should_allow_using_number_placeholder_when_inserting_many(FunctionalTester $I)
 {
     $overrides = ['link_url' => 'http://example.com/{{n}}', 'link_name' => 'Example {{n}}', 'link_image' => 'http://example.com/images/image-{{n}}.jpg', 'link_target' => '_blank', 'link_description' => '{{n}} example link', 'link_visible' => 'N', 'link_owner' => 12, 'link_rating' => 14, 'link_updated' => Date::fromString('today'), 'link_rel' => 'nofollow', 'link_notes' => 'Not a real {{n}} image', 'link_rss' => 'http://example.com/rss/{{n}}'];
     $ids = $I->haveManyLinksInDatabase(5, $overrides);
     $table = $I->grabLinksTableName();
     for ($i = 0; $i < count($ids); $i++) {
         $I->assertTrue(is_int($ids[$i]));
         foreach ($overrides as $key => $value) {
             $I->seeInDatabase($table, ['link_id' => $ids[$i], $key => str_replace('{{n}}', $i, $value)]);
         }
     }
 }