|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* TechDivision\Import\Category\Ee\Subjects\BunchSubjectTest |
|
5
|
|
|
* |
|
6
|
|
|
* NOTICE OF LICENSE |
|
7
|
|
|
* |
|
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
|
9
|
|
|
* that is available through the world-wide-web at this URL: |
|
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
|
11
|
|
|
* |
|
12
|
|
|
* PHP version 5 |
|
13
|
|
|
* |
|
14
|
|
|
* @author Tim Wagner <[email protected]> |
|
15
|
|
|
* @copyright 2016 TechDivision GmbH <[email protected]> |
|
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
|
17
|
|
|
* @link https://github.com/techdivision/import-category-ee |
|
18
|
|
|
* @link http://www.techdivision.com |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
|
|
namespace TechDivision\Import\Category\Ee\Subjects; |
|
22
|
|
|
|
|
23
|
|
|
/** |
|
24
|
|
|
* Test class for the product action implementation. |
|
25
|
|
|
* |
|
26
|
|
|
* @author Tim Wagner <[email protected]> |
|
27
|
|
|
* @copyright 2016 TechDivision GmbH <[email protected]> |
|
28
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
|
29
|
|
|
* @link https://github.com/techdivision/import-category-ee |
|
30
|
|
|
* @link http://www.techdivision.com |
|
31
|
|
|
*/ |
|
32
|
|
|
class EeBunchSubjectTest extends \PHPUnit_Framework_TestCase |
|
33
|
|
|
{ |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* The subject we want to test. |
|
37
|
|
|
* |
|
38
|
|
|
* @var \TechDivision\Import\Category\Ee\Subjects\BunchSubject |
|
39
|
|
|
*/ |
|
40
|
|
|
protected $subject; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Sets up the fixture, for example, open a network connection. |
|
44
|
|
|
* This method is called before a test is executed. |
|
45
|
|
|
* |
|
46
|
|
|
* @return void |
|
47
|
|
|
* @see \PHPUnit_Framework_TestCase::setUp() |
|
48
|
|
|
*/ |
|
49
|
|
|
protected function setUp() |
|
50
|
|
|
{ |
|
51
|
|
|
|
|
52
|
|
|
// create a mock registry processor |
|
53
|
|
|
$mockRegistryProcessor = $this->getMockBuilder('TechDivision\Import\Services\RegistryProcessorInterface') |
|
54
|
|
|
->setMethods(get_class_methods('TechDivision\Import\Services\RegistryProcessorInterface')) |
|
55
|
|
|
->getMock(); |
|
56
|
|
|
|
|
57
|
|
|
// create a generator |
|
58
|
|
|
$mockGenerator = $this->getMockBuilder('TechDivision\Import\Utils\Generators\GeneratorInterface') |
|
59
|
|
|
->setMethods(get_class_methods('TechDivision\Import\Utils\Generators\GeneratorInterface')) |
|
60
|
|
|
->getMock(); |
|
61
|
|
|
|
|
62
|
|
|
// create a mock category processor |
|
63
|
|
|
$mockCategoryProcessor = $this->getMockBuilder('TechDivision\Import\Category\Ee\Services\EeCategoryBunchProcessorInterface') |
|
64
|
|
|
->setMethods(get_class_methods('TechDivision\Import\Category\Ee\Services\EeCategoryBunchProcessorInterface')) |
|
65
|
|
|
->getMock(); |
|
66
|
|
|
|
|
67
|
|
|
|
|
68
|
|
|
// create the subject to be tested |
|
69
|
|
|
$this->subject = new EeBunchSubject( |
|
|
|
|
|
|
70
|
|
|
$mockRegistryProcessor, |
|
71
|
|
|
$mockGenerator, |
|
72
|
|
|
array(), |
|
73
|
|
|
$mockCategoryProcessor |
|
74
|
|
|
); |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* Test's the last row ID setter/getter methods successfull. |
|
79
|
|
|
* |
|
80
|
|
|
* @return void |
|
81
|
|
|
*/ |
|
82
|
|
|
public function testSetGetLastRowId() |
|
83
|
|
|
{ |
|
84
|
|
|
|
|
85
|
|
|
// set the last row ID |
|
86
|
|
|
$this->subject->setLastRowId($lastRowId = 100); |
|
87
|
|
|
|
|
88
|
|
|
// make sure that the last row ID will be returend |
|
89
|
|
|
$this->assertSame($lastRowId, $this->subject->getLastRowId()); |
|
90
|
|
|
} |
|
91
|
|
|
} |
|
92
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..