WordPress.org

Make WordPress Core

Changeset 36718


Ignore:
Timestamp:
02/26/2016 12:38:25 AM (6 years ago)
Author:
SergeyBiryukov
Message:

L10n: Add test for get_available_languages().

Props realloc.
Fixes #35950.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/l10n.php

    r36710 r36718  
    4646        __( 'just some string', 'wp-tests-domain' );
    4747        $this->assertFalse( is_textdomain_loaded( 'wp-tests-domain' ) );
     48    }
     49
     50    /**
     51     * @ticket 35950
     52     */
     53    function test_get_available_languages() {
     54        $array = get_available_languages();
     55        $this->assertInternalType( 'array', $array );
     56
     57        $array = get_available_languages( '.' );
     58        $this->assertEmpty( $array );
     59
     60        $array = get_available_languages( DIR_TESTDATA . '/languages/' );
     61        $this->assertEquals( array( 'en_GB', 'es_ES' ), $array );
    4862    }
    4963
Note: See TracChangeset for help on using the changeset viewer.