コード例 #1
0
 public function test_get_db_version()
 {
     // should init with 0
     $this->assertEquals(0, WC_POS_Settings::get_db_version());
     // bump versions
     WC_POS_Settings::bump_versions();
     $this->assertEquals(WC_POS_VERSION, WC_POS_Settings::get_db_version());
 }
コード例 #2
0
 /**
  * Check version number, runs every admin page load
  */
 private function version_check()
 {
     $old = WC_POS_Settings::get_db_version();
     if (version_compare($old, WC_POS_VERSION, '<')) {
         WC_POS_Settings::bump_versions();
         $this->db_upgrade($old, WC_POS_VERSION);
     }
 }