Make WordPress Core

Ticket #30753: 30753tests.diff

File 30753tests.diff, 814 bytes (added by voldemortensen, 10 years ago)
  • tests/phpunit/tests/functions.php

     
    3838                wp_parse_str($q, $ss);
    3939                $this->assertEquals($ss, wp_parse_args($q));
    4040        }
     41        /**
     42         * @ticket 30753
     43         */
     44        function test_wp_parse_args_boolean() {
     45                // When 'false' and 'true' are passed in query string, make sure the values are strings.
     46                $true = (string)'true';
     47                $false = (string)'false';
     48                $args = wp_parse_args( 'this_should_be_false=false&this_should_be_true=true', array() );
     49                $this->assertSame( $false, $args['this_should_be_false'] );
     50                $this->assertSame( $true, $args['this_should_be_true'] );
     51        }
    4152        function test_size_format() {
    4253                $b  = 1;
    4354                $kb = 1024;