Skip to content

Commit

Permalink
posts connector completed
Browse files Browse the repository at this point in the history
  • Loading branch information
kidunot89 committed Jun 30, 2020
1 parent 70fc052 commit b3d65fb
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions tests/tests/connectors/test-class-connector-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ public function test_callback_transition_post_status() {
)
),
$this->greaterThan( 0 ),
'post',
'updated'
$this->equalTo( 'post' ),
$this->equalTo( 'updated' )
);

// Do stuff
wp_insert_post(
array(
'post_title' => 'Test post',
Expand All @@ -61,9 +62,39 @@ public function test_callback_transition_post_status() {
}

public function test_callback_deleted_post() {
$this->markTestIncomplete(
'Not implemented yet.'
$post_id = wp_insert_post(
array(
'post_title' => 'Test post',
'post_content' => 'Lorem ipsum dolor...',
'post_status' => 'publish'
)
);

$this->mock->expects( $this->atLeastOnce() )
->method( 'log' )
->with(
$this->equalTo(
_x(
'"%1$s" %2$s deleted from trash',
'1: Post title, 2: Post type singular name',
'stream'
)
),
$this->equalTo(
array(
'post_title' => 'Test post',
'singular_name' => 'post',
)
),
$this->greaterThan( 0 ),
$this->equalTo( 'post' ),
$this->equalTo( 'deleted' )
);

// Do stuff
wp_delete_post( $post_id, true );

$this->assertFalse( 0 === did_action( 'wp_stream_test_callback_deleted_post' ) );
}

}

0 comments on commit b3d65fb

Please sign in to comment.