Bart\Configuration\ConfigurationTest::testGetPasswodBetweenDifferentConfigClasses PHP Method

testGetPasswodBetweenDifferentConfigClasses() public method

    public function testGetPasswodBetweenDifferentConfigClasses()
    {
        $this->shmockAndDieselify('\\Bart\\Shell', function ($shell) {
            $shell->std_in_secret('Give us your password: ')->once()->return_value('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');
    }