Example #1
0
 public function testGetBuildProperty()
 {
     $config = $this->getMockBuilder('Propel\\Generator\\Config\\GeneratorConfig')->disableOriginalConstructor()->getMock();
     $config->expects($this->once())->method('getConfigProperty')->with($this->equalTo('generator.database.adapters.mysql.tableType'))->will($this->returnValue('InnoDB'));
     $schema = $this->getSchemaMock('bookstore', ['generator_config' => $config]);
     $database = new Database();
     $database->setParentSchema($schema);
     $this->assertSame('InnoDB', $database->getBuildProperty('generator.database.adapters.mysql.tableType'));
 }
Example #2
0
 /**
  * Returns a build property value for the database this table belongs to.
  *
  * @param  string $key
  * @return string
  */
 public function getBuildProperty($key)
 {
     return $this->database ? $this->database->getBuildProperty($key) : '';
 }
 public function testGetBuildProperty()
 {
     $config = $this->getMock('Propel\\Generator\\Config\\GeneratorConfig');
     $config->expects($this->once())->method('getBuildProperty')->with($this->equalTo('mysqlTableType'))->will($this->returnValue('InnoDB'));
     $schema = $this->getSchemaMock('bookstore', array('generator_config' => $config));
     $database = new Database();
     $database->setParentSchema($schema);
     $this->assertSame('InnoDB', $database->getBuildProperty('mysqlTableType'));
 }