Jsor\Doctrine\PostGIS\Event\DBALSchemaEventSubscriberTest::testAlterTableThrowsExceptionForChangedType PHP Method

testAlterTableThrowsExceptionForChangedType() public method

    public function testAlterTableThrowsExceptionForChangedType()
    {
        $this->setExpectedException('\\RuntimeException', 'The type of a spatial column cannot be changed (Requested changing type from "geometry" to "geography" for column "point_2d" in table "points")');
        $table = $this->sm->listTableDetails('points');
        $tableDiff = new \Doctrine\DBAL\Schema\TableDiff('points');
        $tableDiff->fromTable = $table;
        $tableDiff->changedColumns[] = new ColumnDiff('point_2d', new \Doctrine\DBAL\Schema\Column('point_2d', Type::getType('geography'), array()), array('type'), $table->getColumn('point_2d'));
        $this->sm->alterTable($tableDiff);
    }