Dumplie\Metadata\Tests\Integration\Infrastructure\Doctrine\Dbal\DoctrineStorageTest::test_alter_existing_table PHP Method

test_alter_existing_table() public method

    public function test_alter_existing_table()
    {
        $foo = new TypeSchema('foo', ['id' => new TextField(), 'foo' => new TextField()]);
        $fooSchema = new Schema('test');
        $fooSchema->add($foo);
        $bar = new TypeSchema('foo', ['id' => new TextField(), 'bar' => new TextField()]);
        $barSchema = new Schema('test');
        $barSchema->add($bar);
        $this->storage->create($fooSchema);
        $this->storage->alter($barSchema);
        $result = $this->connection->getSchemaManager()->listTableColumns('metadata_test_foo');
        $this->assertArrayHasKey('bar', $result);
    }