Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AdminConfigFixtureTest.php
Go to the documentation of this file.
1 <?php
11 
12 class AdminConfigFixtureTest extends \PHPUnit\Framework\TestCase
13 {
17  protected $_object;
18 
19  protected function setUp()
20  {
21  $this->_object = $this->createPartialMock(
22  \Magento\TestFramework\Annotation\AdminConfigFixture::class,
23  ['_getConfigValue', '_setConfigValue']
24  );
25  }
26 
30  public function testConfig()
31  {
32  $this->_object->expects(
33  $this->at(0)
34  )->method(
35  '_getConfigValue'
36  )->with(
37  'any_config'
38  )->will(
39  $this->returnValue('some_value')
40  );
41  $this->_object->expects($this->at(1))->method('_setConfigValue')->with('any_config', 'some_value');
42  $this->_object->startTest($this);
43 
44  $this->_object->expects($this->once())->method('_setConfigValue')->with('any_config', 'some_value');
45  $this->_object->endTest($this);
46  }
47 
48  public function testInitStoreAfterOfScope()
49  {
50  $this->_object->expects($this->never())->method('_getConfigValue');
51  $this->_object->expects($this->never())->method('_setConfigValue');
52  $this->_object->initStoreAfter();
53  }
54 
58  public function testInitStoreAfter()
59  {
60  $this->_object->startTest($this);
61  $this->_object->expects(
62  $this->at(0)
63  )->method(
64  '_getConfigValue'
65  )->with(
66  'any_config'
67  )->will(
68  $this->returnValue('some_value')
69  );
70  $this->_object->expects($this->at(1))->method('_setConfigValue')->with('any_config', 'some_value');
71  $this->_object->initStoreAfter();
72  }
73 }