Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FallbackContextTest.php
Go to the documentation of this file.
1 <?php
7 
11 class FallbackContextTest extends \PHPUnit\Framework\TestCase
12 {
16  protected $objectManager;
17 
21  protected $fallbackContext;
22 
23  protected function setUp()
24  {
25  $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
26  }
27 
37  public function testGetConfigPath(
38  $baseUrl,
39  $areaType,
40  $themePath,
41  $localeCode,
42  $expectedResult
43  ) {
44  $this->fallbackContext = $this->objectManager->getObject(
45  \Magento\Framework\View\Asset\File\FallbackContext::class,
46  [
47  'baseUrl' => $baseUrl,
48  'areaType' => $areaType,
49  'themePath' => $themePath,
50  'localeCode' => $localeCode
51  ]
52  );
53  $this->assertEquals($expectedResult, $this->fallbackContext->getConfigPath());
54  }
55 
59  public function getConfigPathDataProvider()
60  {
61  return [
62  'http' => [
63  'baseUrl' => 'http://some-name.com/pub/static/',
64  'areaType' => 'frontend',
65  'themePath' => 'Magento/blank',
66  'localeCode' => 'en_US',
67  'expectedResult' => 'frontend/Magento/blank/en_US'
68  ],
69  'https' => [
70  'baseUrl' => 'https://some-name.com/pub/static/',
71  'areaType' => 'frontend',
72  'themePath' => 'Magento/blank',
73  'localeCode' => 'en_US',
74  'expectedResult' => 'frontend/Magento/blank/en_US'
75  ]
76  ];
77  }
78 }
testGetConfigPath( $baseUrl, $areaType, $themePath, $localeCode, $expectedResult)