WordPress.org

Make WordPress Core

Changeset 31668


Ignore:
Timestamp:
03/07/2015 05:33:48 PM (6 years ago)
Author:
boonebgorges
Message:

User query meta_vars test must account for the 'blog_id' clause added in multisite.

See #31265.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user/query.php

    r31666 r31668  
    363363        ) );
    364364
    365         $this->assertSame( 'foo', $q->meta_query->queries[0]['key'] );
    366         $this->assertSame( '5', $q->meta_query->queries[0]['value'] );
    367         $this->assertSame( '>', $q->meta_query->queries[0]['compare'] );
    368         $this->assertSame( 'SIGNED', $q->meta_query->queries[0]['type'] );
     365        // Multisite adds a 'blog_id' clause, so we have to find the 'foo' clause.
     366        $mq_clauses = $q->meta_query->get_clauses();
     367        foreach ( $mq_clauses as $mq_clause ) {
     368            if ( 'foo' === $mq_clause['key'] ) {
     369                $clause = $mq_clause;
     370            }
     371        }
     372
     373        $this->assertSame( 'foo', $clause['key'] );
     374        $this->assertSame( '5', $clause['value'] );
     375        $this->assertSame( '>', $clause['compare'] );
     376        $this->assertSame( 'SIGNED', $clause['type'] );
    369377    }
    370378
Note: See TracChangeset for help on using the changeset viewer.