WordPress.org

Make WordPress Core

Ticket #24706: 24706-use-table-prefix-in-meta-query-test.diff

File 24706-use-table-prefix-in-meta-query-test.diff, 563 bytes (added by codebykat, 23 months ago)

Use $wpdb->prefix instead of hardcoding "wp_postmeta"

  • tests/meta/query.php

     
    102102                $this->assertEquals( 2, substr_count( $sql['join'], 'INNER JOIN' ) ); 
    103103 
    104104                // The WHERE should check my_third_key against an unaliased table 
    105                 $this->assertEquals( 1, substr_count( $sql['where'], "wp_postmeta.meta_key = 'my_third_key'" ) ); 
     105                $this->assertEquals( 1, substr_count( $sql['where'], $wpdb->prefix."postmeta.meta_key = 'my_third_key'" ) ); 
    106106 
    107107        } 
    108108}