コード例 #1
0
 public function testAddingTimeStamps()
 {
     $blueprint = new Blueprint('users');
     $blueprint->timestamps();
     $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
     $this->assertEquals(1, count($statements));
     $this->assertEquals('alter table "users" add "created_at" datetime not null, "updated_at" datetime not null', $statements[0]);
 }
コード例 #2
0
 public function testAddingTimeStamps()
 {
     $blueprint = new Blueprint('users');
     $blueprint->timestamps();
     $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
     $this->assertEquals(2, count($statements));
     $expected = array('alter table "users" add column "created_at" datetime null', 'alter table "users" add column "updated_at" datetime null');
     $this->assertEquals($expected, $statements);
 }