Code Duplication    Length = 21-21 lines in 2 locations

projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-full-immediately.php 1 location

@@ 478-498 (lines=21) @@
475
		$this->assertEquals( 'the value', $this->server_replica_storage->get_callable( 'jetpack_foo' ) );
476
	}
477
478
	function test_full_sync_sends_all_functions_inverse() {
479
		Modules::get_module( "functions" )->set_callable_whitelist( array( 'jetpack_foo' => 'jetpack_foo_full_sync_callable' ) );
480
481
		// reset the storage, check value, and do full sync - storage should be set!
482
		$this->server_replica_storage->reset();
483
484
		$this->assertEquals( null, $this->server_replica_storage->get_callable( 'jetpack_foo' ) );
485
486
		$this->full_sync->start();
487
		$this->sender->do_full_sync();
488
		$this->server_replica_storage->reset();
489
		$this->server_event_storage->reset();
490
491
		$this->resetCallableAndConstantTimeouts();
492
		$this->sender->do_sync();
493
494
		$this->assertEquals( null, $this->server_replica_storage->get_callable( 'jetpack_foo' ) );
495
		$events = $this->server_event_storage->get_all_events( 'jetpack_sync_callable' );
496
		$this->assertTrue( empty( $events ) );
497
498
	}
499
500
	function test_full_sync_sends_all_options() {
501
		delete_option( 'non_existant' );

projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-full.php 1 location

@@ 656-676 (lines=21) @@
653
		$this->assertEquals( 'the value', $this->server_replica_storage->get_callable( 'jetpack_foo' ) );
654
	}
655
656
	function test_full_sync_sends_all_functions_inverse() {
657
		Modules::get_module( "functions" )->set_callable_whitelist( array( 'jetpack_foo' => 'jetpack_foo_full_sync_callable' ) );
658
659
		// reset the storage, check value, and do full sync - storage should be set!
660
		$this->server_replica_storage->reset();
661
662
		$this->assertEquals( null, $this->server_replica_storage->get_callable( 'jetpack_foo' ) );
663
664
		$this->full_sync->start();
665
		$this->sender->do_full_sync();
666
		$this->server_replica_storage->reset();
667
		$this->server_event_storage->reset();
668
669
		$this->resetCallableAndConstantTimeouts();
670
		$this->sender->do_sync();
671
672
		$this->assertEquals( null, $this->server_replica_storage->get_callable( 'jetpack_foo' ) );
673
		$events = $this->server_event_storage->get_all_events( 'jetpack_sync_callable' );
674
		$this->assertTrue( empty( $events ) );
675
676
	}
677
678
	function test_full_sync_sends_all_options() {
679
		delete_option( 'non_existant' );