public function testForeignKeys() { $table = new Table('test'); $this->assertCount(0, $table->getForeignKeys()); $this->assertInstanceOf('\\Phoenix\\Database\\Element\\Table', $table->addForeignKey(new ForeignKey('first_column', 'foreign_table'))); $this->assertCount(1, $table->getForeignKeys()); $this->assertInstanceOf('\\Phoenix\\Database\\Element\\Table', $table->addForeignKey(new ForeignKey('second_column', 'foreign_table'))); $this->assertCount(2, $table->getForeignKeys()); foreach ($table->getForeignKeys() as $foreignKey) { $this->assertInstanceOf('\\Phoenix\\Database\\Element\\ForeignKey', $foreignKey); } $this->assertInstanceOf('\\Phoenix\\Database\\Element\\Table', $table->dropForeignKey('first_column')); $this->assertCount(1, $table->getForeignKeysToDrop()); $this->assertEquals('test_first_column', $table->getForeignKeysToDrop()[0]); }