Exemplo n.º 1
0
 /**
  * Check that once a schema has been generated, then it doesn't need any more updating
  */
 public function testFieldsDontRerequestChanges()
 {
     // These are MySQL specific :-S
     if (DB::getConn() instanceof MySQLDatabase) {
         $db = DB::getConn();
         DB::quiet();
         // Verify that it doesn't need to be recreated
         $db->beginSchemaUpdate();
         $obj = new MySQLDatabaseTest_DO();
         $obj->requireTable();
         $needsUpdating = $db->doesSchemaNeedUpdating();
         $db->cancelSchemaUpdate();
         $this->assertFalse($needsUpdating);
     }
 }
 /**
  * Check that once a schema has been generated, then it doesn't need any more updating
  */
 public function testFieldsDontRerequestChanges()
 {
     // These are MySQL specific :-S
     if (DB::get_conn() instanceof MySQLDatabase) {
         $schema = DB::get_schema();
         $test = $this;
         DB::quiet();
         // Verify that it doesn't need to be recreated
         $schema->schemaUpdate(function () use($test, $schema) {
             $obj = new MySQLDatabaseTest_DO();
             $obj->requireTable();
             $needsUpdating = $schema->doesSchemaNeedUpdating();
             $schema->cancelSchemaUpdate();
             $test->assertFalse($needsUpdating);
         });
     }
 }