Example #1
0
 public function testLoadFile()
 {
     $settings = ['offset1' => 'offset1_value', 'path1' => ['path1' => ['path1' => 'path1_value']]];
     /** @var Mock|FileLoader $mockedFileLoader */
     $mockedFileLoader = $this->subject->getFileLoader();
     $mockedFileLoader->shouldReceive('load')->with('file.ext', 'config')->once()->andReturn('file_content');
     /** @var Mock|ParserInterface $mockedParser */
     $mockedParser = $this->subject->getParser();
     $mockedParser->shouldReceive('parse')->with('file_content')->once()->andReturn($settings);
     $this->subject->loadFile('file.ext');
     $this->assertSame(['{{placeholder}}' => 'placeholder_value'], $this->subject->getPlaceholders());
     $this->assertSame('offset1_value', $this->subject->get('offset1'));
     $this->assertSame('path1_value', $this->subject->get('path1.path1.path1'));
 }