static function perform() { $latest = upgrade::latest_remote(); $current = upgrade::latest_local(); return $latest > $current ? upgrade::upgrade_to(upgrade::to_version($latest)) : array('status' => 0, 'upgrade' => 0); }
public function test_latest_local() { @define('SC_ROOT', ''); io::staticExpects($this->any())->method('glob')->will($this->returnValue(array('1.0.3', '..', 'test', '1.0.4', '2.0.1'))); $this->assertEquals(2000001, upgrade::latest_local()); }