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
Convert
Test
Unit
ExcelFactoryTest.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Convert\Test\Unit
;
7
8
use
Magento\Framework\Convert\ExcelFactory
;
9
use
Magento\Framework\ObjectManagerInterface
;
10
11
class
ExcelFactoryTest
extends
\PHPUnit\Framework\TestCase
12
{
16
protected
$model
;
17
21
protected
$objectManager
;
22
23
protected
function
setUp
()
24
{
25
$this->objectManager = $this->getMockBuilder(\
Magento
\Framework\ObjectManagerInterface::class)
26
->setMethods([
'create'
])
27
->getMockForAbstractClass();
28
29
$this->model =
new
ExcelFactory
(
30
$this->objectManager
31
);
32
}
33
34
public
function
testCreate
()
35
{
36
$excel = $this->getMockBuilder(\
Magento
\Framework\Convert\Excel::class)
37
->disableOriginalConstructor()
38
->getMock();
39
40
$this->objectManager->expects($this->once())
41
->method(
'create'
)
42
->with(\
Magento
\Framework\Convert\Excel::class, [])
43
->willReturn($excel);
44
45
$this->assertInstanceOf(\
Magento
\Framework\Convert\Excel::class, $this->model->create());
46
}
47
}
Magento\Framework\ObjectManagerInterface
Definition:
ObjectManagerInterface.php:12
Magento\Framework\Convert\Test\Unit
Definition:
ConvertArrayTest.php:7
Magento\Framework\Convert\ExcelFactory
Definition:
ExcelFactory.php:10
Magento\Framework\Convert\Test\Unit\ExcelFactoryTest
Definition:
ExcelFactoryTest.php:11
Magento
Magento\Framework\Convert\Test\Unit\ExcelFactoryTest\$model
$model
Definition:
ExcelFactoryTest.php:16
Magento\Framework\Convert\Test\Unit\ExcelFactoryTest\setUp
setUp()
Definition:
ExcelFactoryTest.php:23
Magento\Framework\Convert\Test\Unit\ExcelFactoryTest\testCreate
testCreate()
Definition:
ExcelFactoryTest.php:34
Magento\Framework\Convert\Test\Unit\ExcelFactoryTest\$objectManager
$objectManager
Definition:
ExcelFactoryTest.php:21