22 private $fileParserMock;
26 $this->fileParserMock = $this->createPartialMock(Parser::class, [
'getDom',
'xmlToArray']);
37 $this->model->loadConfig(
'exception.file');
42 $this->fileParserMock->expects($this->exactly(2))->method(
'xmlToArray')->willReturn(
43 [
'config' => [
'profile' => [
'some_key' =>
'some_value']]]
46 $domMock = $this->createPartialMock(\DOMDocument::class, [
'load',
'xinclude']);
47 $domMock->expects($this->once())->method(
'load')->with(
'config.file')->willReturn(
48 $this->fileParserMock->xmlToArray()
50 $domMock->expects($this->once())->method(
'xinclude');
51 $this->fileParserMock->expects($this->exactly(2))->method(
'getDom')->willReturn($domMock);
53 $this->model->loadConfig(
'config.file');
54 $this->assertSame(
'some_value', $this->model->getValue(
'some_key'));
59 $this->assertSame(
null, $this->model->getValue(
'null_key'));
76 if (strpos($filename,
'exception') !==
false) {
testLoadConfigException()