Bart\Configuration\ConfigurationTest::assertREADME PHP Метод

assertREADME() публичный статический Метод

public static assertREADME ( Bart\BaseTestCase $phpu, $configurationClassName, $configFileName )
$phpu Bart\BaseTestCase
    public static function assertREADME(BaseTestCase $phpu, $configurationClassName, $configFileName)
    {
        $phpu->shmockAndDieselify('\\Bart\\Shell', function ($shell) {
            $shell->std_in_secret()->any()->return_value('secret');
            $shell->std_in()->any()->return_value('secret');
        });
        $phpu->doStuffWithTempDir(function (BaseTestCase $phpu, $dirName) use($configurationClassName, $configFileName) {
            $logger = \Logger::getLogger(__CLASS__);
            $logger->debug("Starting README test for {$configurationClassName}");
            $readme = TestConfigurationsHelper::getReadme($phpu, $configurationClassName);
            file_put_contents("{$dirName}/{$configFileName}", $readme);
            // Reset the cache so that the configs will be read from disk
            $logger->debug("Configuring system to load configs from {$dirName}");
            TestConfigurationsHelper::reset($dirName);
            $configs = new $configurationClassName();
            TestConfigurationsHelper::assertConfigurationGetters($configs, $phpu, $configurationClassName);
        });
    }