Beispiel #1
0
 /**
  * Set the Schema generator configuration
  *
  * @param GeneratorConfigInterface $generatorConfig
  */
 public function setGeneratorConfig(GeneratorConfigInterface $generatorConfig)
 {
     $this->schema->setGeneratorConfig($generatorConfig);
 }
 public function testSetGeneratorConfig()
 {
     $config = $this->getMockBuilder('Propel\\Generator\\Config\\GeneratorConfig')->disableOriginalConstructor()->getMock();
     $schema = new Schema();
     $schema->setGeneratorConfig($config);
     $this->assertSame($config, $schema->getGeneratorConfig());
 }
 public function testSetGeneratorConfig()
 {
     $config = $this->getMock('Propel\\Generator\\Config\\GeneratorConfig');
     $schema = new Schema();
     $schema->setGeneratorConfig($config);
     $this->assertSame($config, $schema->getGeneratorConfig());
 }
Beispiel #4
0
    public function testAutoNamespaceToDatabaseSchemaName()
    {
        $yamlConf = <<<EOF
propel:
  database:
      connections:
          mysource:
              adapter: mysql
              classname: Propel\\Runtime\\Connection\\DebugPDO
              dsn: mysql:host=localhost;dbname=mydb
              user: root
              password:
  generator:
      schema:
          autoNamespace: true
EOF;
        $configFilename = sys_get_temp_dir() . '/propel.yml';
        $filesystem = new Filesystem();
        $filesystem->dumpFile($configFilename, $yamlConf);
        $schema = 'TestSchema';
        $config = new GeneratorConfig($configFilename);
        $platform = new MysqlPlatform();
        $parentSchema = new Schema($platform);
        $parentSchema->setGeneratorConfig($config);
        $db = new Database();
        $db->setPlatform($platform);
        $db->setParentSchema($parentSchema);
        $db->setSchema($schema);
        $this->assertEquals($schema, $db->getNamespace());
    }