WordPress.org

Make WordPress Core

Changeset 897 in tests


Ignore:
Timestamp:
07/09/2012 04:47:34 PM (6 years ago)
Author:
nacin
Message:

Enable PHPUnit strict mode by default.

Mark a test without assertions as incomplete (strict mode will do this implicitly).
Only define a multisite test if is_multisite(), otherwise no assertions are run.

There are now a potential for failures if a test omits output improperly,
or if a test takes too long.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpunit.xml

    r878 r897  
    33        backupGlobals="false"
    44        colors="true"
     5        strict="true"
    56        >
    67    <testsuites>
  • trunk/tests/jacob/TestFormatting.php

    r830 r897  
    4848    }
    4949    function test_returns_false_for_non_utf8_strings() {
     50        $this->markTestIncomplete( 'This test does not have any assertions.' );
     51
    5052        $big5 = $this->get_testdata('test_big5.txt');
    5153        $big5 = $big5[0];
  • trunk/tests/test_option.php

    r867 r897  
    257257}
    258258
     259if ( is_multisite() ) :
    259260/**
    260261 * @group options
    261262 */
    262263class TestBlogOption extends WP_UnitTestCase {
    263     function setUp() {
    264         parent::setUp();
    265     }
    266 
    267     function tearDown() {
    268         parent::tearDown();
    269     }
    270 
    271264    function test_from_same_site() {
    272         if ( ! is_multisite() )
    273             return false;
    274 
    275265        $key = rand_str();
    276266        $key2 = rand_str();
     
    309299    }
    310300}
     301endif;
Note: See TracChangeset for help on using the changeset viewer.