/** * Tests the getChangeColumnSQL method. * * Note that combinations of fields is tested in testGetColumnSQL. * * @return void * * @since 12.1 */ public function testGetChangeColumnSQL() { $instance = new JDatabaseImporterPostgresqlInspector(); $instance->setDbo($this->dbo); $this->assertThat($instance->getChangeColumnSQL('jos_test', new SimpleXmlElement($this->sample['xml-title-field'])), $this->equalTo('ALTER TABLE "jos_test" ALTER COLUMN "title" TYPE character varying(50),' . "\n" . 'ALTER COLUMN "title" SET NOT NULL,' . "\n" . 'ALTER COLUMN "title" DROP DEFAULT'), 'getChangeColumnSQL did not yield the expected result.'); }
/** * Tests the getChangeColumnSQL method. * * Note that combinations of fields is tested in testGetColumnSQL * * @return void * * @since 12.1 */ public function testGetChangeColumnSQL() { $xmlTitleField = '<field Field="title" Type="character varying(50)" Null="NO" Default="NULL" Comments="" />'; $instance = new JDatabaseImporterPostgresqlInspector; $instance->setDbo($this->dbo); $this->assertThat( $instance->getChangeColumnSQL( 'jos_test', new SimpleXmlElement($xmlTitleField) ), $this->equalTo( 'ALTER TABLE "jos_test" ALTER COLUMN "title" TYPE character varying(50),' . "\n" . 'ALTER COLUMN "title" SET NOT NULL,' . "\n" . 'ALTER COLUMN "title" DROP DEFAULT' ), 'getChangeColumnSQL did not yield the expected result.' ); }