Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ReaderTest.php
Go to the documentation of this file.
1 <?php
7 
12 
13 class ReaderTest extends \PHPUnit\Framework\TestCase
14 {
18  private $source;
19 
23  private $reader;
24 
25  public function setUp()
26  {
27  $this->source = $this->getMockBuilder(SourceInterface::class)
28  ->getMockForAbstractClass();
29  $this->reader = new Reader([['class' => $this->source]]);
30  }
31 
32  public function testRead()
33  {
34  $config = [
35  'default' => [
36  'general/locale/code'=> 'ru_RU',
37  'general/locale/timezone'=> 'America/Chicago',
38  ]
39  ];
40  $this->source->expects($this->once())
41  ->method('get')
42  ->with(null)
43  ->willReturn($config);
44  $this->assertEquals($config, $this->reader->read());
45  }
46 }
$config
Definition: fraud_order.php:17