/** * Test the Fluent magic methods can be used to set attributes. * * @test */ public function testMagicMethodsCanBeUsedToSetAttributes() { $fluent = new Fluent(); $fluent->name = 'Taylor'; $fluent->developer(); $fluent->age(25); $this->assertEquals('Taylor', $fluent->name); $this->assertTrue($fluent->developer); $this->assertEquals(25, $fluent->age); $this->assertInstanceOf('Robbo\\SchemaBuilder\\Fluent', $fluent->programmer()); }
/** * Compile a primary key command. * * @param \Illuminate\Database\Schema\Blueprint $blueprint * @param \Illuminate\Support\Fluent $command * @return string */ public function compilePrimary(Blueprint $blueprint, Fluent $command) { $command->name(null); return $this->compileKey($blueprint, $command, 'primary key'); }