Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-config
Test
Unit
Model
Config
Reader
Source
Deployed
DocumentRootTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Config\Test\Unit\Model\Config\Reader\Source\Deployed
;
7
8
use
Magento\Config\Model\Config\Reader
;
9
use
Magento\Framework\App\Config
;
10
use
Magento\Framework\App\DeploymentConfig
;
11
use
Magento\Framework\App\Filesystem\DirectoryList
;
12
use
Magento\Framework\Config\ConfigOptionsListConstants
;
13
use
Magento\Config\Model\Config\Reader\Source\Deployed\DocumentRoot
;
14
18
class
DocumentRootTest
extends
\PHPUnit\Framework\TestCase
19
{
23
private
$configMock;
24
28
private
$documentRoot;
29
30
public
function
setUp
()
31
{
32
$this->configMock = $this->getMockBuilder(DeploymentConfig::class)
33
->disableOriginalConstructor()
34
->getMock();
35
36
$this->documentRoot =
new
DocumentRoot
($this->configMock);
37
}
38
42
public
function
testGetPath
()
43
{
44
$this->configMockSetForDocumentRootIsPub();
45
46
$this->assertSame(
DirectoryList::PUB
, $this->documentRoot->getPath());
47
}
48
53
public
function
testIsPub
()
54
{
55
$this->configMockSetForDocumentRootIsPub();
56
57
$this->assertSame(
true
, $this->documentRoot->isPub());
58
}
59
60
private
function
configMockSetForDocumentRootIsPub()
61
{
62
$this->configMock->expects($this->any())
63
->method(
'get'
)
64
->willReturnMap([
65
[
66
ConfigOptionsListConstants::CONFIG_PATH_DOCUMENT_ROOT_IS_PUB
,
67
null
,
68
true
69
],
70
]);
71
}
72
}
Magento\Framework\App\Config
Definition:
Base.php:9
Magento\Config\Test\Unit\Model\Config\Reader\Source\Deployed\DocumentRootTest
Definition:
DocumentRootTest.php:18
Magento\Config\Test\Unit\Model\Config\Reader\Source\Deployed\DocumentRootTest\testIsPub
testIsPub()
Definition:
DocumentRootTest.php:53
Magento\Config\Model\Config\Reader\Source\Deployed\DocumentRoot
Definition:
DocumentRoot.php:19
Magento\Config\Test\Unit\Model\Config\Reader\Source\Deployed\DocumentRootTest\setUp
setUp()
Definition:
DocumentRootTest.php:30
Magento\Framework\Config\ConfigOptionsListConstants\CONFIG_PATH_DOCUMENT_ROOT_IS_PUB
const CONFIG_PATH_DOCUMENT_ROOT_IS_PUB
Definition:
ConfigOptionsListConstants.php:37
Magento\Framework\Config\ConfigOptionsListConstants
Definition:
ConfigOptionsListConstants.php:16
Magento\Config\Model\Config\Reader
Magento\Framework\App\Filesystem\DirectoryList
Definition:
DirectoryList.php:13
Magento\Framework\App\Filesystem\DirectoryList\PUB
const PUB
Definition:
DirectoryList.php:43
Magento\Config\Test\Unit\Model\Config\Reader\Source\Deployed\DocumentRootTest\testGetPath
testGetPath()
Definition:
DocumentRootTest.php:42
Magento\Config\Test\Unit\Model\Config\Reader\Source\Deployed
Definition:
DocumentRootTest.php:6
Magento\Framework\App\DeploymentConfig
Definition:
CommentParser.php:6