public function testLookUp()
 {
     $this->appMock->expects($this->any())->method('make')->will($this->returnCallback(function ($make) {
         switch ($make) {
             case 'translator':
                 return $this->tranlator;
             default:
                 var_dump($make);
                 die('testLookUp');
         }
     }));
     $this->tranlator->expects($this->any())->method('trans')->will($this->returnCallback(function ($trans) {
         switch ($trans) {
             case 'validation.attributes.login':
                 return 'Login';
             case 'validation.attributes.not_existent':
                 return $trans;
         }
     }));
     $this->assertSame('Login', $this->testInstance->login);
     $this->assertSame('not_existent', $this->testInstance->not_existent);
 }
Example #2
0
 public function testLang()
 {
     $this->translatorMock->expects($this->once())->method('trans')->with('someValue');
     $this->getApplicationMock()->expects($this->once())->method('make')->will($this->returnValue($this->translatorMock));
     $this->testInstance->l('someValue');
 }