Make WordPress Core

Changeset 36710


Ignore:
Timestamp:
02/25/2016 03:01:23 PM (9 years ago)
Author:
ocean90
Message:

L10n: Add test for wp_get_pomo_file_data().

Props realloc.
See #35284.

File:
1 edited

Legend:

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

    r36631 r36710  
    111111    }
    112112
     113    /**
     114     * @ticket 35284
     115     */
     116    function test_wp_get_pomo_file_data() {
     117        $file  = DIR_TESTDATA . '/pomo/empty.po';
     118        $array = wp_get_pomo_file_data( $file );
     119        $this->assertArrayHasKey( 'POT-Creation-Date', $array );
     120        $this->assertArrayHasKey( 'PO-Revision-Date', $array );
     121        $this->assertArrayHasKey( 'Project-Id-Version', $array );
     122        $this->assertArrayHasKey( 'X-Generator', $array );
     123
     124        $file  = DIR_TESTDATA . '/pomo/mo.pot';
     125        $array = wp_get_pomo_file_data( $file );
     126        $this->assertNotEmpty( $array['POT-Creation-Date'] );
     127        $this->assertNotEmpty( $array['PO-Revision-Date'] );
     128        $this->assertNotEmpty( $array['Project-Id-Version'] );
     129        $this->assertArrayHasKey( 'X-Generator', $array );
     130
     131        $file  = DIR_TESTDATA . '/languages/es_ES.po';
     132        $array = wp_get_pomo_file_data( $file );
     133        $this->assertArrayHasKey( 'POT-Creation-Date', $array );
     134        $this->assertNotEmpty( $array['PO-Revision-Date'] );
     135        $this->assertNotEmpty( $array['Project-Id-Version'] );
     136        $this->assertNotEmpty( $array['X-Generator'] );
     137    }
     138
    113139}
Note: See TracChangeset for help on using the changeset viewer.