WordPress.org

Make WordPress Core

Changeset 672 in tests


Ignore:
Timestamp:
04/12/2012 02:43:28 PM (6 years ago)
Author:
nacin
Message:

Update test_upload_is_user_over_quota() to reflect that get_space_allowed() should be returning the default (50) when the user has unlimited space. See #WP18199. Fixes an -m test failure.

Don't have upload_is_user_over_quota() issue echoed warnings when the user is over their quota.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_ms.php

    r521 r672  
    276276    function test_upload_is_user_over_quota() {
    277277        $this->knownWPBug( 18119 );
    278         $this->assertFalse( upload_is_user_over_quota() );
     278
     279        $default_space_allowed = 50;
     280        $echo = false;
     281
     282        $this->assertFalse( upload_is_user_over_quota( $echo ) );
    279283        $this->assertTrue( is_upload_space_available() );
    280284
    281285        update_site_option('upload_space_check_disabled', true);
    282         $this->assertFalse( upload_is_user_over_quota() );
     286        $this->assertFalse( upload_is_user_over_quota( $echo ) );
    283287        $this->assertTrue( is_upload_space_available() );
    284288
    285289        update_site_option( 'blog_upload_space', 0 );
    286         $this->assertFalse( upload_is_user_over_quota() );
    287         $this->assertEquals( 0, get_space_allowed() );
     290        $this->assertFalse( upload_is_user_over_quota( $echo ) );
     291        $this->assertEquals( $default_space_allowed, get_space_allowed() );
    288292        $this->assertTrue( is_upload_space_available() );
    289293
    290294        update_site_option('upload_space_check_disabled', false);
    291         $this->assertFalse( upload_is_user_over_quota() );
     295        $this->assertFalse( upload_is_user_over_quota( $echo ) );
    292296        $this->assertTrue( is_upload_space_available() );
    293297
    294298        update_site_option( 'blog_upload_space', -1 );
    295         $this->assertTrue( upload_is_user_over_quota() );
     299        $this->assertTrue( upload_is_user_over_quota( $echo ) );
    296300        $this->assertEquals( -1, get_space_allowed() );
    297301        $this->assertFalse( is_upload_space_available() );
    298302
    299303        update_option( 'blog_upload_space', 0 );
    300         $this->assertFalse( upload_is_user_over_quota() );
    301         $this->assertEquals( 0, get_space_allowed() );
     304        $this->assertFalse( upload_is_user_over_quota( $echo ) );
     305        $this->assertEquals( $default_space_allowed, get_space_allowed() );
    302306        $this->assertTrue( is_upload_space_available() );
    303307
    304308        update_option( 'blog_upload_space', -1 );
    305         $this->assertTrue( upload_is_user_over_quota() );
     309        $this->assertTrue( upload_is_user_over_quota( $echo ) );
    306310        $this->assertEquals( -1, get_space_allowed() );
    307311        $this->assertFalse( is_upload_space_available() );
Note: See TracChangeset for help on using the changeset viewer.