|
5 | 5 | */
|
6 | 6 | namespace Magento\ImportExport\Test\Unit\Model\Import\ErrorProcessing;
|
7 | 7 |
|
| 8 | +use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError; |
| 9 | + |
8 | 10 | class ProcessingErrorAggregatorTest extends \PHPUnit_Framework_TestCase
|
9 | 11 | {
|
10 | 12 | /**
|
@@ -124,22 +126,26 @@ public function testAddErrorMessageTemplate()
|
124 | 126 |
|
125 | 127 | /**
|
126 | 128 | * Test for method isRowInvalid. Expected true result.
|
| 129 | + * @dataProvider isRowInvalidDataProvider |
127 | 130 | */
|
128 |
| - public function testIsRowInvalidTrue() |
| 131 | + public function testIsRowInvalid($errorLevel, $rowNumber, $isValid) |
129 | 132 | {
|
130 |
| - $this->model->addError('systemException', 'critical', 7, 'Some column name', 'Message', 'Description'); |
131 |
| - $result = $this->model->isRowInvalid(7); |
132 |
| - $this->assertTrue($result); |
| 133 | + $this->model->addError('systemException', $errorLevel, $rowNumber, 'Some column name', 'Message', 'Description'); |
| 134 | + $result = $this->model->isRowInvalid($rowNumber); |
| 135 | + $this->assertEquals($isValid, $result); |
133 | 136 | }
|
134 | 137 |
|
135 | 138 | /**
|
136 |
| - * Test for method isRowInvalid. Expected false result. |
| 139 | + * @return array |
137 | 140 | */
|
138 |
| - public function testIsRowInvalidFalse() |
| 141 | + public function isRowInvalidDataProvider() |
139 | 142 | {
|
140 |
| - $this->model->addError('systemException'); |
141 |
| - $result = $this->model->isRowInvalid(8); |
142 |
| - $this->assertFalse($result); |
| 143 | + return [ |
| 144 | + [ProcessingError::ERROR_LEVEL_CRITICAL, 7, true], |
| 145 | + [ProcessingError::ERROR_LEVEL_NOT_CRITICAL, 8, false], |
| 146 | + [ProcessingError::ERROR_LEVEL_NOTICE, 9, false], |
| 147 | + [ProcessingError::ERROR_LEVEL_WARNING, 10, false] |
| 148 | + ]; |
143 | 149 | }
|
144 | 150 |
|
145 | 151 | /**
|
|
0 commit comments