/** * Factory method for this class. * * @return testable_available_update_checker the singleton instance */ public static function instance() { global $CFG; if (is_null(self::$singletoninstance)) { self::$singletoninstance = new self(); } return self::$singletoninstance; }
public function test_is_same_release_implicit() { $provider = testable_available_update_checker::instance(); $provider->fake_current_environment(2012060102.0, '2.3.2 (Build: 20121012)', '2.3', array()); $this->assertTrue($provider->is_same_release('2.3.2')); $this->assertTrue($provider->is_same_release('2.3.2+')); $this->assertTrue($provider->is_same_release('2.3.2+ (Build: 20121013)')); $this->assertFalse($provider->is_same_release('2.4dev (Build: 20121012)')); }