Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Try different way of mocking
  • Loading branch information
schlessera committed May 5, 2025
commit fdc2bcf479f3130ba6078f93540b079baad0f372
5 changes: 2 additions & 3 deletions tests/UtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,8 @@ public function test_esc_like( $input, $expected ) {
*/
public function test_esc_like_with_wpdb( $input, $expected ) {
global $wpdb;
$wpdb = $this->getMockBuilder( 'wpdb' )->getMock();
$wpdb->expects( $this->once() )
->method( 'esc_like' )
$wpdb = $this->createMock( 'wpdb' );
$wpdb->method( 'esc_like' )
->willReturn( addcslashes( $input, '_%\\' ) );
$this->assertEquals( $expected, Utils\esc_like( $input ) );
$this->assertEquals( $expected, Utils\esc_like( $input ) );
Expand Down