diff --git a/tests/unit/TestGetStrategy.php b/tests/unit/TestGetStrategy.php index da614486f28603d4dfd3f124c6472959c7a86df3..7da82b56f829de2cb217d7a431d48da852c6cd31 100644 --- a/tests/unit/TestGetStrategy.php +++ b/tests/unit/TestGetStrategy.php @@ -29,7 +29,7 @@ class TestGetStrategy extends TestCase { $this->prepare_get(); } - public function testAndClausesFailureTest() { + public function testAndClausesFailure() { $strategy = new GetStrategy( [ [ self::true_1, diff --git a/tests/unit/TestPostTypeStrategy.php b/tests/unit/TestPostTypeStrategy.php index 8b0790f67172d41c6bcdda07b6b67559178c7c05..31eb4caa0bbee85a50bf06945b4c58e3b221ab92 100644 --- a/tests/unit/TestPostTypeStrategy.php +++ b/tests/unit/TestPostTypeStrategy.php @@ -21,31 +21,32 @@ class TestPostTypeStrategy extends TestCase { \WP_Mock::tearDown(); } - public function testInvalidPostTypeFailure() { + public function testFailureWhenTriesUseInvalidPostType() { $strategy = new PostTypeStrategy( self::invalid_post_type ); $this->assertFalse( $strategy->shouldDisplay() ); } - public function testPostTypeUsingGetSuccess() { + public function testValidPostTypeUsingGetSuccess() { $_GET = [ 'post_type' => self::valid_post_type ]; $strategy = new PostTypeStrategy( self::valid_post_type ); $this->assertTrue( $strategy->shouldDisplay() ); } - public function testPostTypeUsingPostSuccess() { + public function testValidPostTypeUsingPostIdSuccess() { $post_id = 123; - $_GET = [ + $_GET = [ 'post' => $post_id ]; - \WP_Mock::userFunction('get_post', [ - 'times' => 1, - 'return' => function() use ($post_id) { - $post = new \WP_Post(); - $post->ID = $post_id; + \WP_Mock::userFunction( 'get_post', [ + 'times' => 1, + 'return' => function () use ( $post_id ) { + $post = new \WP_Post(); + $post->ID = $post_id; $post->post_type = self::valid_post_type; + return $post; } - ]); + ] ); $strategy = new PostTypeStrategy( self::valid_post_type ); $this->assertTrue( $strategy->shouldDisplay() );