/** * Tests static Column::makeList() method. * @deprecated - Column::makeList() is deprecated and set to be removed in 1.3 */ public function testMakeList() { $expected = 'Column0, Column1, Column2, Column3, Column4'; $objArray = array(); for ($i = 0; $i < 5; $i++) { $c = new Column(); $c->setName("Column" . $i); $objArray[] = $c; } $list = Column::makeList($objArray, new DefaultPlatform()); $this->assertEquals($expected, $list, sprintf("Expected '%s' match, got '%s' ", var_export($expected, true), var_export($list, true))); $strArray = array(); for ($i = 0; $i < 5; $i++) { $strArray[] = "Column" . $i; } $list = Column::makeList($strArray, new DefaultPlatform()); $this->assertEquals($expected, $list, sprintf("Expected '%s' match, got '%s' ", var_export($expected, true), var_export($list, true))); }
public function providerForTestGetModifyColumnRemoveDefaultValueDDL() { $t1 = new Table('test'); $t1->setIdentifierQuoting(true); $c1 = new Column(); $c1->setName('test'); $c1->getDomain()->setType('INTEGER'); $c1->setDefaultValue(0); $t1->addColumn($c1); $t2 = new Table('test'); $t2->setIdentifierQuoting(true); $c2 = new Column(); $c2->setName('test'); $c2->getDomain()->setType('INTEGER'); $t2->addColumn($c2); return [[ColumnComparator::computeDiff($c1, $c2)]]; }
public function providerForTestGetModifyColumnRemoveDefaultValueDDL() { $t1 = new Table('test'); $c1 = new Column(); $c1->setName('test'); $c1->getDomain()->setType('INTEGER'); $c1->setDefaultValue(0); $t1->addColumn($c1); $t2 = new Table('test'); $c2 = new Column(); $c2->setName('test'); $c2->getDomain()->setType('INTEGER'); $t2->addColumn($c2); return array(array(PropelColumnComparator::computeDiff($c1, $c2))); }