mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Coding Standards: Always use parentheses when instantiating an object.
Note: This will be enforced by WPCS 3.0.0. Props jrf. See #56791. git-svn-id: https://develop.svn.wordpress.org/trunk@54891 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
class Tests_Functions extends WP_UnitTestCase {
|
||||
public function test_wp_parse_args_object() {
|
||||
$x = new MockClass;
|
||||
$x = new MockClass();
|
||||
$x->_baba = 5;
|
||||
$x->yZ = 'baba'; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
|
||||
$x->a = array( 5, 111, 'x' );
|
||||
@@ -17,7 +17,7 @@ class Tests_Functions extends WP_UnitTestCase {
|
||||
),
|
||||
wp_parse_args( $x )
|
||||
);
|
||||
$y = new MockClass;
|
||||
$y = new MockClass();
|
||||
$this->assertSame( array(), wp_parse_args( $y ) );
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class Tests_Functions extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
public function test_wp_parse_args_defaults() {
|
||||
$x = new MockClass;
|
||||
$x = new MockClass();
|
||||
$x->_baba = 5;
|
||||
$x->yZ = 'baba'; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
|
||||
$x->a = array( 5, 111, 'x' );
|
||||
@@ -1113,7 +1113,7 @@ class Tests_Functions extends WP_UnitTestCase {
|
||||
* @ticket 28786
|
||||
*/
|
||||
public function test_wp_json_encode_object() {
|
||||
$object = new stdClass;
|
||||
$object = new stdClass();
|
||||
$object->a = 'b';
|
||||
$this->assertSame( wp_json_encode( $object ), '{"a":"b"}' );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user