Changeset 34899
- Timestamp:
- 10/07/2015 06:14:14 AM (9 years ago)
- Location:
- trunk/tests/phpunit/tests/multisite
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/site.php
r34898 r34899 1017 1017 } 1018 1018 1019 function test_is_upload_space_available_default() {1020 $this->assertTrue( is_upload_space_available() );1021 }1022 1023 function test_is_upload_space_available_check_disabled() {1024 update_site_option( 'upload_space_check_disabled', true );1025 $this->assertTrue( is_upload_space_available() );1026 }1027 1028 function test_is_upload_space_available_space_used_is_less() {1029 update_site_option( 'upload_space_check_disabled', false );1030 update_site_option( 'blog_upload_space', 350 );1031 add_filter( 'pre_get_space_used', array( $this, '_filter_space_used' ) );1032 $available = is_upload_space_available();1033 remove_filter( 'pre_get_space_used', array( $this, '_filter_space_used' ) );1034 1035 $this->assertTrue( is_upload_space_available() );1036 $this->assertEquals(1037 $available,1038 self::$space_used < 3501039 );1040 }1041 1042 function test_is_upload_space_available_space_used_is_more() {1043 update_site_option( 'upload_space_check_disabled', false );1044 update_site_option( 'blog_upload_space', 250 );1045 add_filter( 'pre_get_space_used', array( $this, '_filter_space_used' ) );1046 $available = is_upload_space_available();1047 $used = get_space_used();1048 remove_filter( 'pre_get_space_used', array( $this, '_filter_space_used' ) );1049 1050 $this->assertEquals(1051 $available,1052 $used < 2501053 );1054 }1055 1056 function test_is_upload_space_available_upload_space_0() {1057 update_site_option( 'upload_space_check_disabled', false );1058 update_site_option( 'blog_upload_space', 0 );1059 $this->assertTrue( is_upload_space_available() );1060 }1061 1062 function test_is_upload_space_available_upload_space_negative() {1063 update_site_option( 'upload_space_check_disabled', false );1064 update_site_option( 'blog_upload_space', -1 );1065 $this->assertFalse( is_upload_space_available() );1066 }1067 1068 1019 /** 1069 1020 * Test the primary purpose of get_blog_post(), to retrieve a post from
Note: See TracChangeset
for help on using the changeset viewer.