[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/t/ -> test_noop_translations.php (source)

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


Generated: Thu May 24 03:59:35 2012 Hosted by follow the white rabbit.