-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move tests to a new sync actions file
- Loading branch information
Showing
2 changed files
with
50 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
class WP_Test_Jetpack_Sync_Actions extends WP_UnitTestCase { | ||
function test_get_sync_status() { | ||
$no_checksum = Jetpack_Sync_Actions::get_sync_status(); | ||
$this->assertArrayNotHasKey( 'posts_checksum', $no_checksum ); | ||
$this->assertArrayNotHasKey( 'comments_checksum', $no_checksum ); | ||
$this->assertArrayNotHasKey( 'post_meta_checksum', $no_checksum ); | ||
$this->assertArrayNotHasKey( 'comment_meta_checksum', $no_checksum ); | ||
|
||
$kitchen_sink_checksum = Jetpack_Sync_Actions::get_sync_status( | ||
'posts_checksum,comments_checksum,post_meta_checksum,comment_meta_checksum' | ||
); | ||
$this->assertArrayHasKey( 'posts_checksum', $kitchen_sink_checksum ); | ||
$this->assertArrayHasKey( 'comments_checksum', $kitchen_sink_checksum ); | ||
$this->assertArrayHasKey( 'post_meta_checksum', $kitchen_sink_checksum ); | ||
$this->assertArrayHasKey( 'comment_meta_checksum', $kitchen_sink_checksum ); | ||
|
||
$posts = Jetpack_Sync_Actions::get_sync_status( 'posts_checksum' ); | ||
$this->assertArrayHasKey( 'posts_checksum', $posts ); | ||
$this->assertArrayNotHasKey( 'comments_checksum', $posts ); | ||
$this->assertArrayNotHasKey( 'post_meta_checksum', $posts ); | ||
$this->assertArrayNotHasKey( 'comment_meta_checksum', $posts ); | ||
|
||
$comments = Jetpack_Sync_Actions::get_sync_status( | ||
'comments_checksum' | ||
); | ||
$this->assertArrayNotHasKey( 'posts_checksum', $comments ); | ||
$this->assertArrayHasKey( 'comments_checksum', $comments ); | ||
$this->assertArrayNotHasKey( 'post_meta_checksum', $comments ); | ||
$this->assertArrayNotHasKey( 'comment_meta_checksum', $comments ); | ||
|
||
$post_meta = Jetpack_Sync_Actions::get_sync_status( | ||
'post_meta_checksum' | ||
); | ||
$this->assertArrayNotHasKey( 'posts_checksum', $post_meta ); | ||
$this->assertArrayNotHasKey( 'comments_checksum', $post_meta ); | ||
$this->assertArrayHasKey( 'post_meta_checksum', $post_meta ); | ||
$this->assertArrayNotHasKey( 'comment_meta_checksum', $post_meta ); | ||
|
||
$comment_meta = Jetpack_Sync_Actions::get_sync_status( | ||
'comment_meta_checksum' | ||
); | ||
$this->assertArrayNotHasKey( 'posts_checksum', $comment_meta ); | ||
$this->assertArrayNotHasKey( 'comments_checksum', $comment_meta ); | ||
$this->assertArrayNotHasKey( 'post_meta_checksum', $comment_meta ); | ||
$this->assertArrayHasKey( 'comment_meta_checksum', $comment_meta ); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters