WordPress.org

Make WordPress Core

Ticket #35284: 35284.2.patch

File 35284.2.patch, 2.1 KB (added by ocean90, 5 years ago)
  • tests/phpunit/includes/bootstrap.php

     
    2626define( 'WP_TESTS_TABLE_PREFIX', $table_prefix );
    2727define( 'DIR_TESTDATA', dirname( __FILE__ ) . '/../data' );
    2828
     29define( 'WP_LANG_DIR', DIR_TESTDATA . '/languages' );
     30
    2931if ( ! defined( 'WP_TESTS_FORCE_KNOWN_BUGS' ) )
    3032        define( 'WP_TESTS_FORCE_KNOWN_BUGS', false );
    3133
  • tests/phpunit/tests/l10n.php

     
    2626                $this->assertEquals( 'first-before-bar|second-before-bar', before_last_bar( 'first-before-bar|second-before-bar|after-last-bar' ) );
    2727        }
    2828
     29        /**
     30         * @ticket 35284
     31         * @slowThreshold 700
     32         */
     33        function test_wp_get_installed_translations_for_core() {
     34                $installed_translations = wp_get_installed_translations( 'core' );
     35                $this->assertInternalType( 'array', $installed_translations );
     36                $this->assertNotEmpty( $installed_translations );
     37
     38                $textdomains_expected = array( 'admin', 'admin-network', 'continents-cities', 'default' );
     39                $this->assertEqualSets( $textdomains_expected, array_keys( $installed_translations ) );
     40
     41                $this->assertNotEmpty( $installed_translations['default']['en_GB'] );
     42                $data_en_GB = $installed_translations['default']['en_GB'];
     43                $this->assertEquals( '2016-01-14 21:14:29+0000', $data_en_GB['PO-Revision-Date'] );
     44                $this->assertEquals( 'Development (4.4.x)', $data_en_GB['Project-Id-Version'] );
     45                $this->assertEquals( 'GlotPress/1.0-alpha-1100', $data_en_GB['X-Generator'] );
     46
     47                $this->assertNotEmpty( $installed_translations['admin']['es_ES'] );
     48                $data_es_ES = $installed_translations['admin']['es_ES'];
     49                $this->assertEquals( '2015-12-22 20:26:46+0000', $data_es_ES['PO-Revision-Date'] );
     50                $this->assertEquals( 'Administration', $data_es_ES['Project-Id-Version'] );
     51                $this->assertEquals( 'GlotPress/1.0-alpha-1100', $data_es_ES['X-Generator'] );
     52        }
    2953}