public function test_sync_maybe_update_core() { _maybe_update_core(); $this->client->do_sync(); $updates = $this->server_replica_storage->get_updates('core'); $this->assertTrue(is_int($updates->last_checked)); }
public function test_sync_maybe_update_core() { if (is_multisite()) { $this->markTestSkipped('Not compatible with multisite mode'); } _maybe_update_core(); $this->sender->do_sync(); $updates = $this->server_replica_storage->get_updates('core'); $this->assertTrue(is_int($updates->last_checked)); }
function test_full_sync_sends_core_updates() { _maybe_update_core(); $this->client->do_sync(); // check that an update just finished $updates = $this->server_replica_storage->get_updates('core'); $this->assertTrue($updates->last_checked > strtotime("-10 seconds")); // we need to do this because there's a check for elapsed time since last update // in the wp_update_core() function delete_site_transient('update_core'); $this->server_replica_storage->reset(); $this->assertNull($this->server_replica_storage->get_updates('core')); // full sync should re-check for plugin updates $this->full_sync->start(); $this->client->do_sync(); $updates = $this->server_replica_storage->get_updates('core'); $this->assertNotNull($updates); $this->assertTrue($updates->last_checked > strtotime("-10 seconds")); }
private function enqueue_all_updates() { $this->set_status('updates', 0); // check for updates wp_update_plugins(); wp_update_themes(); _maybe_update_core(); $this->set_status('updates', 100); }
function test_full_sync_sends_core_updates() { if (is_multisite()) { $this->markTestSkipped('Not compatible with multisite mode'); } _maybe_update_core(); $this->sender->do_sync(); // check that an update just finished $updates = $this->server_replica_storage->get_updates('core'); $this->assertTrue($updates->last_checked > strtotime("-10 seconds")); // we need to do this because there's a check for elapsed time since last update // in the wp_update_core() function $this->server_replica_storage->reset(); $this->assertNull($this->server_replica_storage->get_updates('core')); // full sync should re-check for plugin updates $this->full_sync->start(); $this->sender->do_full_sync(); $updates = $this->server_replica_storage->get_updates('core'); $this->assertNotNull($updates); $this->assertTrue($updates->last_checked > strtotime("-10 seconds")); }