SanitizePost.php 539 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * @group formatting
  4. * @group post
  5. */
  6. class Tests_Formatting_SanitizePost extends WP_UnitTestCase {
  7. /**
  8. * @ticket 22324
  9. */
  10. function test_int_fields() {
  11. $post = $this->factory->post->create_and_get();
  12. $int_fields = array(
  13. 'ID' => 'integer',
  14. 'post_parent' => 'integer',
  15. 'menu_order' => 'integer',
  16. 'post_author' => 'string',
  17. 'comment_count' => 'string',
  18. );
  19. foreach ( $int_fields as $field => $type ) {
  20. $this->assertInternalType( $type, $post->$field, "field $field" );
  21. }
  22. }
  23. }