|
@@ 49-56 (lines=8) @@
|
| 46 |
|
set_current_screen( 'post-user' ); // this only works in is_admin() |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
function test_white_listed_function_is_synced() { |
| 50 |
|
$this->callable_module->set_callable_whitelist( array( 'jetpack_foo' => 'jetpack_foo_is_callable' ) ); |
| 51 |
|
|
| 52 |
|
$this->sender->do_sync(); |
| 53 |
|
|
| 54 |
|
$synced_value = $this->server_replica_storage->get_callable( 'jetpack_foo' ); |
| 55 |
|
$this->assertEquals( jetpack_foo_is_callable(), $synced_value ); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
/** |
| 59 |
|
* Verify that when a callable returns an anonymous function we don't fatal. |
|
@@ 61-68 (lines=8) @@
|
| 58 |
|
/** |
| 59 |
|
* Verify that when a callable returns an anonymous function we don't fatal. |
| 60 |
|
*/ |
| 61 |
|
public function test_anonymous_function_callable() { |
| 62 |
|
$this->callable_module->set_callable_whitelist( array( 'jetpack_foo_anon' => 'jetpack_foo_is_anon_callable' ) ); |
| 63 |
|
|
| 64 |
|
$this->sender->do_sync(); |
| 65 |
|
|
| 66 |
|
$synced_value = $this->server_replica_storage->get_callable( 'jetpack_foo_anon' ); |
| 67 |
|
$this->assertEquals( null, $synced_value ); |
| 68 |
|
} |
| 69 |
|
|
| 70 |
|
public function test_sync_jetpack_updates() { |
| 71 |
|
$this->sender->do_sync(); |
|
@@ 1172-1178 (lines=7) @@
|
| 1169 |
|
/** |
| 1170 |
|
* Test "sync_callable_recursive_gets_checksum". |
| 1171 |
|
*/ |
| 1172 |
|
public function test_sync_callable_recursive_gets_checksum() { |
| 1173 |
|
|
| 1174 |
|
$this->callable_module->set_callable_whitelist( array( 'jetpack_banana' => 'jetpack_recursive_banana' ) ); |
| 1175 |
|
$this->sender->do_sync(); |
| 1176 |
|
$synced_value = $this->server_replica_storage->get_callable( 'jetpack_banana' ); |
| 1177 |
|
$this->assertTrue( ! empty( $synced_value ), 'We couldn\'t synced a value!' ); |
| 1178 |
|
} |
| 1179 |
|
|
| 1180 |
|
/** |
| 1181 |
|
* Test get_hosting_provider() callable to ensure that known hosts have the |