Changeset 42343 for trunk/tests/phpunit/tests/post/isPostTypeViewable.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/isPostTypeViewable.php
r36402 r42343 6 6 class Tests_Post_IsPostTypeViewable extends WP_UnitTestCase { 7 7 public function test_should_return_false_for_non_publicly_queryable_types() { 8 register_post_type( 'wptests_pt', array( 9 'publicly_queryable' => false, 10 '_builtin' => false, 11 'public' => true, 12 ) ); 8 register_post_type( 9 'wptests_pt', array( 10 'publicly_queryable' => false, 11 '_builtin' => false, 12 'public' => true, 13 ) 14 ); 13 15 14 16 $pt = get_post_type_object( 'wptests_pt' ); … … 18 20 19 21 public function test_should_return_true_for_publicly_queryable_types() { 20 register_post_type( 'wptests_pt', array( 21 'publicly_queryable' => true, 22 '_builtin' => false, 23 'public' => false, 24 ) ); 22 register_post_type( 23 'wptests_pt', array( 24 'publicly_queryable' => true, 25 '_builtin' => false, 26 'public' => false, 27 ) 28 ); 25 29 26 30 $pt = get_post_type_object( 'wptests_pt' ); … … 30 34 31 35 public function test_should_return_false_for_builtin_nonpublic_types() { 32 register_post_type( 'wptests_pt', array( 33 'publicly_queryable' => false, 34 '_builtin' => true, 35 'public' => false, 36 ) ); 36 register_post_type( 37 'wptests_pt', array( 38 'publicly_queryable' => false, 39 '_builtin' => true, 40 'public' => false, 41 ) 42 ); 37 43 38 44 $pt = get_post_type_object( 'wptests_pt' ); … … 42 48 43 49 public function test_should_return_false_for_nonbuiltin_public_types() { 44 register_post_type( 'wptests_pt', array( 45 'publicly_queryable' => false, 46 '_builtin' => false, 47 'public' => true, 48 ) ); 50 register_post_type( 51 'wptests_pt', array( 52 'publicly_queryable' => false, 53 '_builtin' => false, 54 'public' => true, 55 ) 56 ); 49 57 50 58 $pt = get_post_type_object( 'wptests_pt' ); … … 54 62 55 63 public function test_should_return_true_for_builtin_public_types() { 56 register_post_type( 'wptests_pt', array( 57 'publicly_queryable' => false, 58 '_builtin' => true, 59 'public' => true, 60 ) ); 64 register_post_type( 65 'wptests_pt', array( 66 'publicly_queryable' => false, 67 '_builtin' => true, 68 'public' => true, 69 ) 70 ); 61 71 62 72 $pt = get_post_type_object( 'wptests_pt' ); … … 77 87 */ 78 88 public function test_should_accept_post_type_name() { 79 register_post_type( 'wptests_pt', array( 80 'publicly_queryable' => true, 81 '_builtin' => false, 82 'public' => false, 83 ) ); 89 register_post_type( 90 'wptests_pt', array( 91 'publicly_queryable' => true, 92 '_builtin' => false, 93 'public' => false, 94 ) 95 ); 84 96 85 97 $this->assertTrue( is_post_type_viewable( 'wptests_pt' ) );
Note: See TracChangeset
for help on using the changeset viewer.