|
1 | 1 | <?php
|
2 | 2 | /**
|
3 |
| - * Copyright © 2013-2017 Magento, Inc. All rights reserved. |
| 3 | + * Copyright © 2013-2018 Magento, Inc. All rights reserved. |
4 | 4 | * See COPYING.txt for license details.
|
5 | 5 | */
|
6 | 6 |
|
@@ -97,7 +97,7 @@ protected function setUp()
|
97 | 97 | ->disableOriginalConstructor()
|
98 | 98 | ->getMockForAbstractClass();
|
99 | 99 | $this->select = $this->getMockBuilder(Select::class)
|
100 |
| - ->setMethods(['from', 'joinInner', 'joinLeft', 'where', 'columns']) |
| 100 | + ->setMethods(['from', 'joinInner', 'joinLeft', 'where', 'columns', 'order']) |
101 | 101 | ->disableOriginalConstructor()
|
102 | 102 | ->getMock();
|
103 | 103 | $this->connectionMock->expects($this->any())
|
@@ -161,10 +161,28 @@ public function testGetAttributeOptions(array $options)
|
161 | 161 |
|
162 | 162 | $this->select->expects($this->exactly(1))->method('from')->willReturnSelf();
|
163 | 163 | $this->select->expects($this->exactly(1))->method('columns')->willReturnSelf();
|
164 |
| - $this->select->expects($this->exactly(5))->method('joinInner')->willReturnSelf(); |
| 164 | + $this->select->expects($this->exactly(6))->method('joinInner')->willReturnSelf(); |
165 | 165 | $this->select->expects($this->exactly(3))->method('joinLeft')->willReturnSelf();
|
| 166 | + $this->select->expects($this->exactly(1))->method('order')->willReturnSelf(); |
166 | 167 | $this->select->expects($this->exactly(2))->method('where')->willReturnSelf();
|
167 | 168 |
|
| 169 | + $this->attributeResource->expects($this->exactly(9)) |
| 170 | + ->method('getTable') |
| 171 | + ->will( |
| 172 | + $this->returnValueMap( |
| 173 | + [ |
| 174 | + ['catalog_product_super_attribute', 'catalog_product_super_attribute value'], |
| 175 | + ['catalog_product_entity', 'catalog_product_entity value'], |
| 176 | + ['catalog_product_super_link', 'catalog_product_super_link value'], |
| 177 | + ['eav_attribute', 'eav_attribute value'], |
| 178 | + ['catalog_product_entity', 'catalog_product_entity value'], |
| 179 | + ['catalog_product_super_attribute_label', 'catalog_product_super_attribute_label value'], |
| 180 | + ['eav_attribute_option', 'eav_attribute_option value'], |
| 181 | + ['eav_attribute_option_value', 'eav_attribute_option_value value'] |
| 182 | + ] |
| 183 | + ) |
| 184 | + ); |
| 185 | + |
168 | 186 | $this->abstractAttribute->expects($this->any())
|
169 | 187 | ->method('getBackendTable')
|
170 | 188 | ->willReturn('getBackendTable value');
|
@@ -193,10 +211,27 @@ public function testGetAttributeOptionsWithBackendModel(array $options)
|
193 | 211 |
|
194 | 212 | $this->select->expects($this->exactly(1))->method('from')->willReturnSelf();
|
195 | 213 | $this->select->expects($this->exactly(0))->method('columns')->willReturnSelf();
|
196 |
| - $this->select->expects($this->exactly(5))->method('joinInner')->willReturnSelf(); |
| 214 | + $this->select->expects($this->exactly(6))->method('joinInner')->willReturnSelf(); |
197 | 215 | $this->select->expects($this->exactly(1))->method('joinLeft')->willReturnSelf();
|
| 216 | + $this->select->expects($this->exactly(1))->method('order')->willReturnSelf(); |
198 | 217 | $this->select->expects($this->exactly(2))->method('where')->willReturnSelf();
|
199 | 218 |
|
| 219 | + $this->attributeResource->expects($this->exactly(7)) |
| 220 | + ->method('getTable') |
| 221 | + ->will( |
| 222 | + $this->returnValueMap( |
| 223 | + [ |
| 224 | + ['catalog_product_super_attribute', 'catalog_product_super_attribute value'], |
| 225 | + ['catalog_product_entity', 'catalog_product_entity value'], |
| 226 | + ['catalog_product_super_link', 'catalog_product_super_link value'], |
| 227 | + ['eav_attribute', 'eav_attribute value'], |
| 228 | + ['catalog_product_entity', 'catalog_product_entity value'], |
| 229 | + ['catalog_product_super_attribute_label', 'catalog_product_super_attribute_label value'], |
| 230 | + ['eav_attribute_option', 'eav_attribute_option value'] |
| 231 | + ] |
| 232 | + ) |
| 233 | + ); |
| 234 | + |
200 | 235 | $source = $this->getMockBuilder(AbstractSource::class)
|
201 | 236 | ->disableOriginalConstructor()
|
202 | 237 | ->setMethods(['getOptionText'])
|
|
0 commit comments