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
framework
View
Test
Unit
TemplateEnginePoolTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\Test\Unit
;
7
8
use \Magento\Framework\View\TemplateEnginePool;
9
10
class
TemplateEnginePoolTest
extends
\PHPUnit\Framework\TestCase
11
{
15
protected
$_model
;
16
20
protected
$_factory
;
21
22
protected
function
setUp
()
23
{
24
$this->_factory = $this->createMock(\
Magento
\Framework\View\TemplateEngineFactory::class);
25
$this->_model =
new
TemplateEnginePool
($this->_factory);
26
}
27
28
public
function
testGet
()
29
{
30
$engine = $this->createMock(\
Magento
\Framework\View\TemplateEngineInterface::class);
31
$this->_factory->expects($this->once())->method(
'create'
)->with(
'test'
)->will($this->returnValue($engine));
32
$this->assertSame($engine, $this->_model->get(
'test'
));
33
// Make sure factory is invoked only once and the same instance is returned afterwards
34
$this->assertSame($engine, $this->_model->get(
'test'
));
35
}
36
}
Magento\Framework\View\Test\Unit
Magento\Framework\View\Test\Unit\TemplateEnginePoolTest\$_model
$_model
Definition:
TemplateEnginePoolTest.php:15
Magento\Framework\View\Test\Unit\TemplateEnginePoolTest
Definition:
TemplateEnginePoolTest.php:10
Magento\Framework\View\Test\Unit\TemplateEnginePoolTest\setUp
setUp()
Definition:
TemplateEnginePoolTest.php:22
Magento\Framework\View\TemplateEnginePool
Definition:
TemplateEnginePool.php:12
Magento\Framework\View\Test\Unit\TemplateEnginePoolTest\testGet
testGet()
Definition:
TemplateEnginePoolTest.php:28
Magento
Magento\Framework\View\Test\Unit\TemplateEnginePoolTest\$_factory
$_factory
Definition:
TemplateEnginePoolTest.php:20