Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AppConfigTest.php
Go to the documentation of this file.
1 <?php
11 
14 
15 class AppConfigTest extends \PHPUnit\Framework\TestCase
16 {
20  private $model;
21 
22  protected function setUp()
23  {
24  $this->model = new \Magento\TestFramework\Isolation\AppConfig();
25  }
26 
27  protected function tearDown()
28  {
29  $this->model = null;
30  }
31 
32  public function testStartTestEndTest()
33  {
34  $test = $this->getMockBuilder(\PHPUnit\Framework\TestCase::class)
35  ->disableOriginalConstructor()
36  ->getMock();
37  $modelReflection = new \ReflectionClass($this->model);
38  $testAppConfigProperty = $modelReflection->getProperty('testAppConfig');
39  $testAppConfigProperty->setAccessible(true);
40  $testAppConfigMock = $this->getMockBuilder(\Magento\TestFramework\App\Config::class)
41  ->disableOriginalConstructor()
42  ->getMock();
43  $testAppConfigProperty->setValue($this->model, $testAppConfigMock);
44  $testAppConfigMock->expects($this->once())
45  ->method('clean');
46  $this->model->startTest($test);
47  }
48 }