Make WordPress Core

Ticket #23895: 23895_tests.patch

File 23895_tests.patch, 1.6 KB (added by biskobe, 9 years ago)

Tests for modified wp_max_upload_size function in previous patch.

  • tests/phpunit/tests/upload.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    9090                $this->assertEquals( '', $info['error'] );
    9191        }
    9292
     93
     94
     95        function test_get_max_upload_size_proper_value_zero_first() {
     96                if (is_multisite()) {
     97                        $this->markTestSkipped("This test doesn't work on multisite");
     98                }
     99
     100                $result = wp_max_upload_size(0,5);
     101                $this->assertEquals(5, $result);
     102        }
     103
     104
     105        function test_get_max_upload_size_proper_value_zero_second() {
     106                if (is_multisite()) {
     107                        $this->markTestSkipped("This test doesn't work on multisite");
     108                }
     109
     110                $result = wp_max_upload_size(7,0);
     111                $this->assertEquals(7, $result);
     112        }
     113
     114        function test_get_max_upload_size_proper_value_bigger_first() {
     115                if (is_multisite()) {
     116                        $this->markTestSkipped("This test doesn't work on multisite");
     117                }
     118
     119                $result = wp_max_upload_size(70,40);
     120                $this->assertEquals(40, $result);
     121        }
     122
     123        function test_get_max_upload_size_proper_value_bigger_second() {
     124                if (is_multisite()) {
     125                        $this->markTestSkipped("This test doesn't work on multisite");
     126                }
     127
     128                $result = wp_max_upload_size(70,110);
     129                $this->assertEquals(70, $result);
     130        }
     131
     132        function test_get_max_upload_size_proper_value_equal() {
     133                if (is_multisite()) {
     134                        $this->markTestSkipped("This test doesn't work on multisite");
     135                }
     136
     137                $result = wp_max_upload_size(40,40);
     138                $this->assertEquals(40, $result);
     139        }
     140
    93141}