コード例 #1
0
ファイル: UnitTest.php プロジェクト: lisong/cphalcon
 /**
  * Tests offsetGet
  *
  * @author Nikos Dimopoulos <*****@*****.**>
  * @since  2012-10-30
  */
 public function testOffsetGet()
 {
     $language = $this->config['tr']['en'];
     $params = array('content' => $language);
     $translator = new PhTranslateAdapterNativeArray($params);
     $expected = 'Hello';
     $actual = $translator->offsetGet('hi');
     $this->assertEquals($expected, $actual, 'Translator does not return proper string with offsetGet');
 }
コード例 #2
0
 /**
  * Tests the offsetGet
  *
  * @author Nikolaos Dimopoulos <*****@*****.**>
  * @since  2014-09-12
  */
 public function testOffsetGet()
 {
     $this->specify("The key does not exist with offsetGet", function () {
         $language = $this->config['en'];
         $params = ['content' => $language];
         $translator = new PhTTranslateAdapterNativeArray($params);
         $expected = 'Hello';
         $actual = $translator->offsetGet('hi');
         expect($actual)->equals($expected);
     });
 }