public function testAddingString() { $blueprint = new Blueprint('users'); $blueprint->string('foo'); $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); $this->assertEquals(1, count($statements)); $this->assertEquals('alter table users add ( foo varchar2(255) not null )', $statements[0]); $blueprint = new Blueprint('users'); $blueprint->string('foo', 100); $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); $this->assertEquals(1, count($statements)); $this->assertEquals('alter table users add ( foo varchar2(100) not null )', $statements[0]); $blueprint = new Blueprint('users'); $blueprint->string('foo', 100)->nullable()->default('bar'); $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); $this->assertEquals(1, count($statements)); $this->assertEquals('alter table users add ( foo varchar2(100) default \'bar\' null )', $statements[0]); $blueprint = new Blueprint('users'); $blueprint->string('foo', 100)->nullable()->default(new Illuminate\Database\Query\Expression('CURRENT TIMESTAMP')); $statements = $blueprint->toSql($this->getConnection(), $this->getGrammar()); $this->assertEquals(1, count($statements)); $this->assertEquals('alter table users add ( foo varchar2(100) default CURRENT TIMESTAMP null )', $statements[0]); }