/** * Parse one type * * @param array $options * @return void */ protected function _parseByTypeOptions($options) { foreach ($this->_getFiles($options) as $file) { $adapter = $this->_adapters[$options['type']]; $adapter->parse($file); list($contextType, $contextValue) = $this->_context->getContextByPath($file); foreach ($adapter->getPhrases() as $phraseData) { $this->_addPhrase($phraseData, $contextType, $contextValue); } } }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Invalid path given: "invalid_path". */ public function testGetContextByPathWithInvalidPath() { $this->context->getContextByPath('invalid_path'); }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Invalid path given: "invalid_path". */ public function testGetContextByPathWithInvalidPath() { $this->componentRegistrar->expects($this->any())->method('getPaths')->willReturnMap([[ComponentRegistrar::MODULE, ['/path/to/module']], [ComponentRegistrar::THEME, ['/path/to/theme']]]); $this->context = new Context($this->componentRegistrar); $this->context->getContextByPath('invalid_path'); }