Adds a unit test to demonstrate that the order of case and default in a switch statement does not matter.

See #27882.



git-svn-id: https://develop.svn.wordpress.org/trunk@28631 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-05-30 17:31:51 +00:00
parent a0dbf001c5
commit 1a1994b20f

View File

@@ -159,4 +159,22 @@ EOF;
$this->assertFalse( isset( $basic->foo ) );
}
function test_switch_order() {
$return = $this->_switch_order_helper( 1 );
$this->assertEquals( 'match', $return );
}
function _switch_order_helper( $var ) {
$return = 'no match';
switch ( $var ) {
default:
break;
case 1:
$return = 'match';
break;
}
return $return;
}
}