public function doRun(InputInterface $input, OutputInterface $output) { $password = getenv('VAULT_PASSWORD'); $tries = 0; while (!$password) { $question = new Question('Vault password: '******'question'); $password = $helper->ask($input, $output, $question); } $this->vault = new Vault($password, $output); // Defaults $this->vault->setStoragePath(getcwd() . '/vault'); $this->vault->setWorkPath(getcwd() . '/secure'); $this->vault->verify(); // Load droid.yml $filename = $this->getVaultFilename(); if ($filename && file_exists($filename)) { $loader = new JsonLoader(); $loader->load($vault, $filename); } else { } return parent::doRun($input, $output); }
/** * bad format. php5.4 won't support syntax error ! * * @covers Phossa\Config\Loader\JsonLoader::load() * @expectedException Phossa\Config\Exception\LogicException */ public function testLoad3() { $this->assertEquals(['test' => 'json'], JsonLoader::load(__DIR__ . '/conf/config_bad.json')); }
/** * Test loading a dir */ public function testLoadDir() { $data = (object) ['grp3' => ['one', 'two', 'three']]; $result = $this->loader->load(CONFIGTEST_SUPPORT_PATH . '/test-any'); $this->assertEquals($data, $result); }