mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Code Modernisation: Fix known instances of array access on data types that can't be accessed as arrays.
PHP 7.4 addes a warning when trying access a null/bool/int/float/resource (everything but array, string and object) as if it were an array. This change fixes all of these warnings visible in unit tests. Props jrf. See #47704. git-svn-id: https://develop.svn.wordpress.org/trunk@45639 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -24,7 +24,7 @@ class Tests_Query_GeneratePostdata extends WP_UnitTestCase {
|
||||
$data = generate_postdata( $fake->ID );
|
||||
|
||||
// Fails because there's no post with this ID.
|
||||
$this->assertNotSame( $fake->ID, $data['id'] );
|
||||
$this->assertFalse( $data );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -150,7 +150,7 @@ class Tests_TermExists extends WP_UnitTestCase {
|
||||
|
||||
_unregister_taxonomy( 'foo' );
|
||||
|
||||
$this->assertSame( null, $found['term_id'] );
|
||||
$this->assertSame( null, $found );
|
||||
}
|
||||
|
||||
public function test_term_exists_taxonomy_nonempty_parent_nonempty_match_name() {
|
||||
|
||||
Reference in New Issue
Block a user