Make WordPress Core

Ticket #35115: 35115.tests.diff

File 35115.tests.diff, 1.3 KB (added by johnbillion, 9 years ago)
  • tests/phpunit/tests/query/vars.php

     
     1<?php
     2
     3/**
     4 * Tests to make sure query vars are as expected.
     5 *
     6 * @group query
     7 */
     8class Tests_Query_Vars extends WP_UnitTestCase {
     9
     10        /**
     11         * @ticket 35115
     12         */
     13        public function testPublicQueryVarsAreAsExpected() {
     14                global $wp;
     15                $this->assertEquals( array(
     16
     17                        // Static public query vars:
     18                        'm',
     19                        'p',
     20                        'posts',
     21                        'w',
     22                        'cat',
     23                        'withcomments',
     24                        'withoutcomments',
     25                        's',
     26                        'search',
     27                        'exact',
     28                        'sentence',
     29                        'calendar',
     30                        'page',
     31                        'paged',
     32                        'more',
     33                        'tb',
     34                        'pb',
     35                        'author',
     36                        'order',
     37                        'orderby',
     38                        'year',
     39                        'monthnum',
     40                        'day',
     41                        'hour',
     42                        'minute',
     43                        'second',
     44                        'name',
     45                        'category_name',
     46                        'tag',
     47                        'feed',
     48                        'author_name',
     49                        'static',
     50                        'pagename',
     51                        'page_id',
     52                        'error',
     53                        'attachment',
     54                        'attachment_id',
     55                        'subpost',
     56                        'subpost_id',
     57                        'preview',
     58                        'robots',
     59                        'taxonomy',
     60                        'term',
     61                        'cpage',
     62                        'post_type',
     63                        'embed',
     64
     65                        // Dynamically added public query vars:
     66                        'post_format',
     67                        'rest_route',
     68
     69                ), $wp->public_query_vars, 'Care should be taken when introducing new public query vars' );
     70        }
     71
     72}