username() public method

public username ( )
Beispiel #1
0
 public function testGetUsername()
 {
     $this->shmockAndDieselify('\\Bart\\Shell', function ($shell) {
         $shell->get_effective_user_name()->once()->return_value('jbraynard');
     });
     $configs = new TestConfig();
     $username = $configs->username();
     $this->assertEquals('jbraynard', $username, 'username');
     // Should use cache and not call get_effective_user_name a second time
     $username = $configs->username();
     $this->assertEquals('jbraynard', $username, 'username');
 }