[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/tests/phpunit/testcases/ -> test_noop_translations.php (source)

   1  <?php
   2  
   3  class GP_Test_NOOP_Translations extends GP_UnitTestCase {
   4  	function setUp() {
   5          parent::setUp();
   6          $this->noop = new NOOP_Translations;
   7          $this->entry = new Translation_Entry( array( 'singular' => 'baba' ) );
   8          $this->plural_entry = new Translation_Entry(array('singular' => 'dyado', 'plural' => 'dyados', 'translations' => array('dyadox', 'dyadoy')));
   9      }
  10  
  11  	function test_get_header() {
  12          $this->assertEquals( false, $this->noop->get_header( 'Content-Type' ) );
  13      }
  14  
  15  	function test_add_entry() {
  16          $this->noop->add_entry( $this->entry );
  17          $this->assertEquals( array(), $this->noop->entries );
  18      }
  19  
  20  	function test_set_header() {
  21          $this->noop->set_header( 'header', 'value' );
  22          $this->assertEquals( array(), $this->noop->headers );
  23      }
  24  
  25  	function test_translate_entry() {
  26          $this->noop->add_entry( $this->entry );
  27          $this->assertEquals( false, $this->noop->translate_entry( $this->entry ) );
  28      }
  29  
  30  	function test_translate() {
  31          $this->noop->add_entry( $this->entry );
  32          $this->assertEquals( 'baba', $this->noop->translate( 'baba' ) );
  33      }
  34  
  35  	function test_plural() {
  36          $this->noop->add_entry( $this->plural_entry );
  37          $this->assertEquals( 'dyado', $this->noop->translate_plural( 'dyado', 'dyados', 1 ) );
  38          $this->assertEquals( 'dyados', $this->noop->translate_plural( 'dyado', 'dyados', 11 ) );
  39          $this->assertEquals( 'dyados', $this->noop->translate_plural( 'dyado', 'dyados', 0 ) );
  40      }
  41  }


Generated: Thu Nov 21 01:01:07 2024 Cross-referenced by PHPXref 0.7.1