Skip to content
Snippets Groups Projects
Commit 5d75f577 authored by dyszczo's avatar dyszczo
Browse files

tests

parent 3c368084
No related branches found
No related tags found
1 merge request!1Feature/init
Pipeline #1949 failed
...@@ -29,7 +29,7 @@ class TestGetStrategy extends TestCase { ...@@ -29,7 +29,7 @@ class TestGetStrategy extends TestCase {
$this->prepare_get(); $this->prepare_get();
} }
public function testAndClausesFailureTest() { public function testAndClausesFailure() {
$strategy = new GetStrategy( [ $strategy = new GetStrategy( [
[ [
self::true_1, self::true_1,
......
...@@ -21,18 +21,18 @@ class TestPostTypeStrategy extends TestCase { ...@@ -21,18 +21,18 @@ class TestPostTypeStrategy extends TestCase {
\WP_Mock::tearDown(); \WP_Mock::tearDown();
} }
public function testInvalidPostTypeFailure() { public function testFailureWhenTriesUseInvalidPostType() {
$strategy = new PostTypeStrategy( self::invalid_post_type ); $strategy = new PostTypeStrategy( self::invalid_post_type );
$this->assertFalse( $strategy->shouldDisplay() ); $this->assertFalse( $strategy->shouldDisplay() );
} }
public function testPostTypeUsingGetSuccess() { public function testValidPostTypeUsingGetSuccess() {
$_GET = [ 'post_type' => self::valid_post_type ]; $_GET = [ 'post_type' => self::valid_post_type ];
$strategy = new PostTypeStrategy( self::valid_post_type ); $strategy = new PostTypeStrategy( self::valid_post_type );
$this->assertTrue( $strategy->shouldDisplay() ); $this->assertTrue( $strategy->shouldDisplay() );
} }
public function testPostTypeUsingPostSuccess() { public function testValidPostTypeUsingPostIdSuccess() {
$post_id = 123; $post_id = 123;
$_GET = [ $_GET = [
'post' => $post_id 'post' => $post_id
...@@ -43,6 +43,7 @@ class TestPostTypeStrategy extends TestCase { ...@@ -43,6 +43,7 @@ class TestPostTypeStrategy extends TestCase {
$post = new \WP_Post(); $post = new \WP_Post();
$post->ID = $post_id; $post->ID = $post_id;
$post->post_type = self::valid_post_type; $post->post_type = self::valid_post_type;
return $post; return $post;
} }
] ); ] );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment