Bart\Configuration\TestConfig::password PHP Method

password() public method

public password ( )
    public function password()
    {
        return $this->getCurrentPassword('Give us your password: ');
    }

Usage Example

Beispiel #1
0
 public function testGetPasswodBetweenDifferentConfigClasses()
 {
     $this->shmockAndDieselify('\\Bart\\Shell', function ($shell) {
         $shell->std_in_secret('Give us your password: '******'iamgod');
     });
     $configs = new TestConfig();
     $password = $configs->password();
     $this->assertEquals('iamgod', $password, 'pwd');
     // Completely separate configuration class; shares only static cache
     $pwConfigs = new TestPasswdConfig();
     // Should use cache from above and not call std_in_secret again
     $pwdPwd = $pwConfigs->password();
     $this->assertEquals('iamgod', $pwdPwd, 'pwd');
 }