@@ 736-761 (lines=26) @@ | ||
733 | $this->assertTrue( $this->server_replica_storage->current_theme_supports( 'post-thumbnails' ) ); |
|
734 | } |
|
735 | ||
736 | function test_full_sync_sends_plugin_updates() { |
|
737 | ||
738 | if ( is_multisite() ) { |
|
739 | $this->markTestSkipped( 'Not compatible with multisite mode' ); |
|
740 | } |
|
741 | ||
742 | wp_update_plugins(); |
|
743 | $this->check_for_updates_to_sync(); |
|
744 | $this->sender->do_sync(); |
|
745 | ||
746 | // check that an update just finished |
|
747 | $updates = $this->server_replica_storage->get_updates( 'plugins' ); |
|
748 | $this->assertTrue( $updates->last_checked > strtotime( "-10 seconds" ) ); |
|
749 | ||
750 | $this->server_replica_storage->reset(); |
|
751 | ||
752 | $this->assertNull( $this->server_replica_storage->get_updates( 'plugins' ) ); |
|
753 | ||
754 | // full sync should re-check for plugin updates |
|
755 | $this->full_sync->start(); |
|
756 | $this->sender->do_full_sync(); |
|
757 | ||
758 | $updates = $this->server_replica_storage->get_updates( 'plugins' ); |
|
759 | $this->assertNotNull( $updates ); |
|
760 | $this->assertTrue( $updates->last_checked > strtotime( "-10 seconds" ), 'Last checked is less then 2 seconds: ' . $updates->last_checked . ' - lest then 10 sec:' . strtotime( "-10 seconds" ) ); |
|
761 | } |
|
762 | ||
763 | function check_for_updates_to_sync() { |
|
764 | $updates_module = Modules::get_module( 'updates' ); |
@@ 905-930 (lines=26) @@ | ||
902 | $updates_module->sync_last_event(); |
|
903 | } |
|
904 | ||
905 | function test_full_sync_sends_plugin_updates() { |
|
906 | ||
907 | if ( is_multisite() ) { |
|
908 | $this->markTestSkipped( 'Not compatible with multisite mode' ); |
|
909 | } |
|
910 | ||
911 | wp_update_plugins(); |
|
912 | $this->check_for_updates_to_sync(); |
|
913 | $this->sender->do_sync(); |
|
914 | ||
915 | // check that an update just finished |
|
916 | $updates = $this->server_replica_storage->get_updates( 'plugins' ); |
|
917 | $this->assertTrue( $updates->last_checked > strtotime( "-10 seconds" ) ); |
|
918 | ||
919 | $this->server_replica_storage->reset(); |
|
920 | ||
921 | $this->assertNull( $this->server_replica_storage->get_updates( 'plugins' ) ); |
|
922 | ||
923 | // full sync should re-check for plugin updates |
|
924 | $this->full_sync->start(); |
|
925 | $this->sender->do_full_sync(); |
|
926 | ||
927 | $updates = $this->server_replica_storage->get_updates( 'plugins' ); |
|
928 | $this->assertNotNull( $updates ); |
|
929 | $this->assertTrue( $updates->last_checked > strtotime( "-10 seconds" ), 'Last checked is less then 2 seconds: ' . $updates->last_checked . ' - lest then 10 sec:' . strtotime( "-10 seconds" ) ); |
|
930 | } |
|
931 | ||
932 | function test_full_sync_sends_theme_updates() { |
|
933 |