/** カレントディレクトリ値を改変する */ protected function setCurrentDirectory(array &$world, array $arguments) { $this->assertEquals(1, count($arguments), '引数は 1 つ必要'); Environment::setCurrentDirectory(getcwd() . $arguments[0]); }
/** 存在しないカレントディレクトリ値は設定できない */ protected function errorIfSetInvalidDirectory(array &$world, array $arguments) { $this->assertEquals(1, count($arguments), '引数は 1 つ必要'); $callback = function () use($world, $arguments) { Environment::setCurrentDirectory($arguments[0]); }; $this->assertException($callback, 'InvalidArgumentException', "The path does not exist. :{$arguments[0]}"); }