示例#1
0
 protected function setUp()
 {
     $this->testFilesDir = dirname(__FILE__) . '/testfiles';
     $this->tempDir = $this->createTempDir('ezcDatabaseSchemaCustomClassesTest');
     ezcDbSchema::setOptions(new ezcDbSchemaOptions(array('tableClassName' => 'ezcDbSchemaTable', 'fieldClassName' => 'ezcDbSchemaField', 'indexClassName' => 'ezcDbSchemaIndex', 'indexFieldClassName' => 'ezcDbSchemaIndexField')));
 }
示例#2
0
 public function testWriteWithoutPrefixReadWithPrefix()
 {
     $optionsWithoutPrefix = new ezcDbSchemaOptions();
     $optionsWithoutPrefix->tableNamePrefix = '';
     $optionsWithPrefix = new ezcDbSchemaOptions();
     $optionsWithPrefix->tableNamePrefix = 'prefix_';
     $schema = new ezcDbSchema(self::getSchema());
     $schemaWithPrefix = new ezcDbSchema(self::getSchemaWithPrefixedTableNames());
     ezcDbSchema::setOptions($optionsWithoutPrefix);
     $schemaWithPrefix->writeToDb($this->db);
     ezcDbSchema::setOptions($optionsWithPrefix);
     $newSchema = ezcDbSchema::createFromDb($this->db);
     self::assertEquals($schema, $newSchema);
 }