/
FullTest.php
43 lines (37 loc) · 1.23 KB
/
FullTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Test\Unit\Model\Indexer\Product\Eav\Action;
class FullTest extends \PHPUnit_Framework_TestCase
{
public function testExecuteWithAdapterErrorThrowsException()
{
$eavDecimalFactory = $this->getMock(
'Magento\Catalog\Model\Resource\Product\Indexer\Eav\DecimalFactory',
['create'],
[],
'',
false
);
$eavSourceFactory = $this->getMock(
'Magento\Catalog\Model\Resource\Product\Indexer\Eav\SourceFactory',
['create'],
[],
'',
false
);
$exceptionMessage = 'exception message';
$exception = new \Exception($exceptionMessage);
$eavDecimalFactory->expects($this->once())
->method('create')
->will($this->throwException($exception));
$model = new \Magento\Catalog\Model\Indexer\Product\Eav\Action\Full(
$eavDecimalFactory,
$eavSourceFactory
);
$this->setExpectedException('Magento\Framework\Exception\LocalizedException', $exceptionMessage);
$model->execute();
}
}