コード例 #1
0
 /**
  * @group mysql5
  */
 public function testFullBuildMysql5()
 {
     $this->apply_options_mysql5();
     $this->setup_mysql5();
     // build base full, check contents
     $base_db_doc = xml_parser::xml_composite(array($this->xml_file_a, $this->xml_file_a));
     mysql5::build($this->output_prefix, $base_db_doc);
     $text = file_get_contents($this->output_prefix . '_build.sql');
     // make sure NOT NULL is specified for action column
     $this->assertContains('`action` character varying(16) NOT NULL', $text);
     // make sure NOT NULL is NOT specified for description column
     $this->assertNotContains('`description` character varying(200) NOT NULL', $text);
     // build base + strict, check contents
     $strict_db_doc = xml_parser::xml_composite(array($this->xml_file_a, $this->xml_file_b));
     mysql5::build($this->output_prefix, $strict_db_doc);
     $text = file_get_contents($this->output_prefix . '_build.sql');
     // make sure NOT NULL is specified for action column
     $this->assertContains('`action` character varying(16) NOT NULL', $text);
     // make sure NOT NULL is specified for description column
     $this->assertContains('`description` character varying(200) NOT NULL', $text);
     // build base + strict + new table, check contents
     $addtable_db_doc = xml_parser::xml_composite(array($this->xml_file_a, $this->xml_file_b, $this->xml_file_c));
     mysql5::build($this->output_prefix, $addtable_db_doc);
     $text = file_get_contents($this->output_prefix . '_build.sql');
     // make sure NOT NULL is specified for resolution column
     $this->assertContains('`resolution` character varying(16) NOT NULL', $text);
     // make sure NOT NULL is NOT specified for points column
     $this->assertNotContains('`points` int NOT NULL', $text);
 }
コード例 #2
0
 protected function build_db_mysql5()
 {
     $this->apply_options_mysql5();
     // build the DDL first, incase dbsteward code wants to throw about something
     mysql5::build($this->output_prefix, xml_parser::xml_composite(array($this->xml_file_a)));
     $this->mysql5->create_db();
     // build initial "A" database
     $this->mysql5->run_file($this->output_prefix . '_build.sql');
 }