mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user