Skip to content

Commit

Permalink
Fix test to create and use post
Browse files Browse the repository at this point in the history
If a WPGHS_Post was passed an ID that didn't exist in
the database, it would still be treated as new even if
it shouldn't have been. Once this bug was fixed, it
exposed this problem in the tests, which assumed we
could pretend that if a Post is passed an ID, it exists
in the DB. This resolves that inconsistency.
  • Loading branch information
mAAdhaTTah committed Jan 30, 2016
1 parent a626540 commit 19419fc
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/unit/test-import.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,13 @@ public function test_should_save_post_title_as_post_title() {
}

public function test_should_save_ID_as_post_id() {
$id = $this->factory->post->create();
$this->blob_content = 'Post content.';
$this->blob_meta = array(
'ID' => 1
);
$this->post_meta = array(
'_sha' => $this->sha,
);
$this->blob_meta = array( 'ID' => $id );
$this->post_meta = array( '_sha' => $this->sha );
$this->post_args = array(
'post_content' => $this->blob_content,
'ID' => 1,
'ID' => $id,
);

$this->validate_meta();
Expand Down

0 comments on commit 19419fc

Please sign in to comment.