InitialConfigSourceTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\App\Test\Unit\Config;
  7. use Magento\Framework\App\Config\InitialConfigSource;
  8. use Magento\Framework\App\DeploymentConfig\Reader;
  9. class InitialConfigSourceTest extends \PHPUnit\Framework\TestCase
  10. {
  11. /**
  12. * @var Reader|\PHPUnit_Framework_MockObject_MockObject
  13. */
  14. private $reader;
  15. /**
  16. * @var string
  17. */
  18. private $configType;
  19. /**
  20. * @var InitialConfigSource
  21. */
  22. private $source;
  23. public function setUp()
  24. {
  25. $this->reader = $this->getMockBuilder(Reader::class)
  26. ->disableOriginalConstructor()
  27. ->getMock();
  28. $this->configType = 'configType';
  29. $this->source = new InitialConfigSource($this->reader, $this->configType);
  30. }
  31. public function testGet()
  32. {
  33. $path = 'path';
  34. $this->reader->expects($this->once())
  35. ->method('load')
  36. ->willReturn([$this->configType => [$path => 'value']]);
  37. $this->assertEquals('value', $this->source->get($path));
  38. }
  39. }