Skip to content

Commit

Permalink
Fix quotes and coding standards issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Zodiac1978 committed Jun 13, 2024
1 parent cfb123c commit 0ade800
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/WP_SQLite_Translator_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ public function testRegexpReplace() {
$this->assertQuery( "SELECT * FROM _options WHERE REGEXP_REPLACE(option_name, '(-ignore|-remove)', '') = 'test'" );
$this->assertCount( 2, $this->engine->get_query_results() );

$this->assertQuery( 'SELECT REGEXP_REPLACE( null, 'a', 'x') as result' );
$this->assertQuery( "SELECT REGEXP_REPLACE( null, 'a', 'x') as result" );
$results = $this->engine->get_query_results();
$this->assertEquals( null, $results[0]->result );

$this->assertQuery( 'SELECT REGEXP_REPLACE( 'abc', null, 'x') as result' );
$this->assertQuery( "SELECT REGEXP_REPLACE( 'abc', null, 'x') as result" );
$results = $this->engine->get_query_results();
$this->assertEquals( null, $results[0]->result );

$this->assertQuery( 'SELECT REGEXP_REPLACE( 'abc', 'a', null) as result' );
$this->assertQuery( "SELECT REGEXP_REPLACE( 'abc', 'a', null) as result" );
$results = $this->engine->get_query_results();
$this->assertEquals( null, $results[0]->result );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ public function regexp_replace( $field, $pattern, $replacement ) {
* be reasonably safe since PHP does not allow null bytes in
* regular expressions anyway.
*/

/* Return null if one of the required parameter is null */
if ( is_null( $field ) || is_null( $pattern ) || is_null( $replacement ) ) {
return null;
Expand Down

0 comments on commit 0ade800

Please sign in to comment.