Skip to content

Commit 4e4c097

Browse files
committed
Fix deprecation warnings in existing tests
1 parent 75c38e6 commit 4e4c097

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

tests/mysql/WP_MySQL_Server_Suite_Lexer_Tests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function test_tokenize_mysql_test_suite(): void {
2121
}
2222

2323
try {
24-
while ( ( $record = fgetcsv( $handle ) ) !== false ) {
24+
while ( ( $record = fgetcsv( $handle, null, ',', '"', '\\' ) ) !== false ) {
2525
$query = $record[0];
2626
$lexer = new WP_MySQL_Lexer( $query );
2727
$tokens = $lexer->remaining_tokens();

tests/mysql/WP_MySQL_Server_Suite_Parser_Tests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function data_parse_mysql_test_suite(): Generator {
7575
try {
7676
$data = array();
7777
$batch = 1;
78-
while ( ( $record = fgetcsv( $handle ) ) !== false ) {
78+
while ( ( $record = fgetcsv( $handle, null, ',', '"', '\\' ) ) !== false ) {
7979
$data[] = $record;
8080
if ( count( $data ) === 1000 ) {
8181
yield "batch-$batch" => array( $data );

wp-includes/sqlite-ast/class-wp-sqlite-driver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ private function execute_update_statement( WP_Parser_Node $node ): void {
15981598
* UPDATE t, information_schema.columns c SET t.column = c.column ...
15991599
*/
16001600
foreach ( $table_alias_map as $alias => $data ) {
1601-
if ( 'information_schema' === strtolower( $data['database'] ) ) {
1601+
if ( 'information_schema' === strtolower( $data['database'] ?? '' ) ) {
16021602
throw $this->new_access_denied_to_information_schema_exception();
16031603
}
16041604
}
@@ -2281,7 +2281,7 @@ private function execute_show_statement( WP_Parser_Node $node ): void {
22812281
'flags' => array( 'not_null' ),
22822282
'table' => '',
22832283
'name' => 'Create Table',
2284-
'len' => strlen( $sql ),
2284+
'len' => strlen( $sql ?? '' ),
22852285
'precision' => 31,
22862286
),
22872287
);

0 commit comments

Comments
 (0)