-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd32bfe
commit 10d0b96
Showing
1 changed file
with
35 additions
and
0 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,35 @@ | ||
<?php | ||
/** | ||
* Class TopTenTest | ||
* | ||
* @package Top_Ten | ||
*/ | ||
|
||
/** | ||
* Sample test case. | ||
*/ | ||
class TopTenTest extends WP_UnitTestCase { | ||
|
||
/** | ||
* Test initialization of the plugin | ||
*/ | ||
public function test_plugin_initialized() { | ||
$this->assertTrue( class_exists( '\WebberZone\Top_Ten\Main' ) ); | ||
} | ||
|
||
/** | ||
* Create a test post and verify author | ||
*/ | ||
public function test_create_post() { | ||
$user_id = $this->factory->user->create(); | ||
$post_id = $this->factory->post->create( | ||
array( | ||
'post_author' => $user_id, | ||
'post_status' => 'publish', | ||
) | ||
); | ||
|
||
$post = get_post( $post_id ); | ||
$this->assertEquals( $user_id, $post->post_author ); | ||
} | ||
} |