Make WordPress Core


Ignore:
Timestamp:
05/01/2017 08:34:10 PM (8 years ago)
Author:
johnbillion
Message:

Build/Test Tools: Automatically skip tests in the ms-required and ms-excluded groups.

This removes the need to manually call $this->skipWithMultisite() and $this->skipWithoutMultisite() from within the test when the test only runs without Multisite or only runs on Multisite, respectively.

Props jdgrimes for the suggestion.

Fixes #40531

File:
1 edited

Legend:

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

    r40543 r40564  
    556556     */
    557557    public function test_roles_and_caps_should_be_populated_for_explicit_value_of_blog_id_on_nonms() {
    558         $this->skipWithMultisite();
    559 
    560558        $query = new WP_User_Query( array(
    561559            'include' => self::$author_ids[0],
     
    575573     */
    576574    public function test_roles_and_caps_should_be_populated_for_explicit_value_of_current_blog_id_on_ms() {
    577         $this->skipWithoutMultisite();
    578 
    579575        $query = new WP_User_Query( array(
    580576            'include' => self::$author_ids[0],
     
    594590     */
    595591    public function test_roles_and_caps_should_be_populated_for_explicit_value_of_different_blog_id_on_ms_when_fields_all_with_meta() {
    596         $this->skipWithoutMultisite();
    597 
    598592        $b = self::factory()->blog->create();
    599593
     
    619613     */
    620614    public function test_roles_and_caps_should_be_populated_for_explicit_value_of_different_blog_id_on_ms_when_fields_all() {
    621         $this->skipWithoutMultisite();
    622 
    623615        $b = self::factory()->blog->create();
    624616        add_user_to_blog( $b, self::$author_ids[0], 'author' );
     
    643635     */
    644636    public function test_who_authors() {
    645         $this->skipWithoutMultisite();
    646 
    647637        $b = self::factory()->blog->create();
    648638
     
    668658     */
    669659    public function test_who_authors_should_work_alongside_meta_query() {
    670         $this->skipWithoutMultisite();
    671 
    672660        $b = self::factory()->blog->create();
    673661
     
    702690     */
    703691    public function test_who_authors_should_work_alongside_meta_params() {
    704         $this->skipWithoutMultisite();
    705 
    706692        $b = self::factory()->blog->create();
    707693
     
    794780     */
    795781    public function test_has_published_posts_should_respect_blog_id() {
    796         $this->skipWithoutMultisite();
    797 
    798782        $blogs = self::factory()->blog->create_many( 2 );
    799783
     
    13601344     */
    13611345    public function test_blog_id_should_restrict_by_blog_without_requiring_a_named_role() {
    1362         $this->skipWithoutMultisite();
    1363 
    13641346        $sites = self::factory()->blog->create_many( 2 );
    13651347
     
    13811363     */
    13821364    public function test_calling_prepare_query_a_second_time_should_not_add_another_cap_query_on_multisite() {
    1383         $this->skipWithoutMultisite();
    1384 
    13851365        $site_id = get_current_blog_id();
    13861366        add_user_to_blog( $site_id, self::$author_ids[0], 'author' );
Note: See TracChangeset for help on using the changeset viewer.