-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #13735: [Forwardport] Fix adding values to system variable collection (by @nmalevanec) - #13733: [Forwardport] Refactoring: remove unuseful temporary variable (by @nmalevanec) - #13731: [Forwardport] Display a more meaningful error message in case of misspelt module name (by @nmalevanec) - #13727: [Forwardport] Show maintenance IP-address without commas (by @nmalevanec) - #13729: [Forwardport] Update StorageInterface.php (by @nmalevanec) - #13635: [Forwardport] #13498 issue #13497 - Method getUrl in Magento\Catalog\Model\Product\Attribute\Frontend\Image (by @nmalevanec) - #13686: #13685: Replaced .size() with .length to be compatible with jQuery 3.* (by @kirmorozov) - magento-engcom/magento2ce#1203: Report error csv doesn't work when trying to import a csv file with semicolon delimiter[forwardport]. (by @nmalevanec) - #13361: Fix URL passed to static.php in PHP in-development server (by @nieltg) Fixed GitHub Issues: - #5015: Report error csv doesn't work when trying to import a csv file with semicolon delimiter (reported by @agoeurysky) has been fixed in magento-engcom/magento2ce#1203 by @nmalevanec in 2.3-develop branch Related commits: 1. 7c03614
- Loading branch information
Showing
15 changed files
with
184 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
app/code/Magento/Variable/Test/Unit/Model/ResourceModel/Variable/CollectionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?php | ||
/*** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Variable\Test\Unit\Model\ResourceModel\Variable; | ||
|
||
use Magento\Framework\DB\Adapter\AdapterInterface; | ||
use Magento\Framework\DB\Select; | ||
use Magento\Framework\Model\ResourceModel\Db\AbstractDb; | ||
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; | ||
use Magento\Variable\Model\ResourceModel\Variable\Collection; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Provide tests for Variable collection class. | ||
*/ | ||
class CollectionTest extends TestCase | ||
{ | ||
/** | ||
* Test Collection::addValuesToResult() build correct query. | ||
* | ||
* @return void | ||
*/ | ||
public function testAddValuesToResult() | ||
{ | ||
$mainTableName = 'testMainTable'; | ||
$tableName = 'variable_value'; | ||
$field = 'value_table.store_id'; | ||
|
||
$select = $this->getMockBuilder(Select::class) | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$select->expects($this->once()) | ||
->method('from') | ||
->with($this->identicalTo(['main_table' => $mainTableName])) | ||
->willReturnSelf(); | ||
$select->expects($this->once()) | ||
->method('join') | ||
->with( | ||
$this->identicalTo(['value_table' => $tableName]), | ||
$this->identicalTo('value_table.variable_id = main_table.variable_id'), | ||
$this->identicalTo(['value_table.plain_value', 'value_table.html_value']) | ||
)->willReturnSelf(); | ||
|
||
$connection = $this->getMockBuilder(AdapterInterface::class) | ||
->disableOriginalConstructor() | ||
->setMethods(['select', 'prepareSqlCondition', 'quoteIdentifier']) | ||
->getMockForAbstractClass(); | ||
$connection->expects($this->any()) | ||
->method('select') | ||
->willReturn($select); | ||
$connection->expects($this->once()) | ||
->method('quoteIdentifier') | ||
->with($this->identicalTo($field)) | ||
->willReturn($field); | ||
$connection->expects($this->once()) | ||
->method('prepareSqlCondition') | ||
->with( | ||
$this->identicalTo($field), | ||
$this->identicalTo(['eq' => 0]) | ||
)->willReturn('testResultCondition'); | ||
|
||
$resource = $this->getMockBuilder(AbstractDb::class) | ||
->setMethods(['getTable', 'getMainTable', 'getConnection']) | ||
->disableOriginalConstructor() | ||
->getMockForAbstractClass(); | ||
$resource->expects($this->any()) | ||
->method('getConnection') | ||
->willReturn($connection); | ||
$resource->expects($this->once()) | ||
->method('getMainTable') | ||
->willReturn('testMainTable'); | ||
$resource->expects($this->exactly(2)) | ||
->method('getTable') | ||
->withConsecutive( | ||
[$mainTableName], | ||
[$tableName] | ||
)->willReturnOnConsecutiveCalls( | ||
$mainTableName, | ||
$tableName | ||
); | ||
|
||
$objectManager = new ObjectManager($this); | ||
$collection = $objectManager->getObject( | ||
Collection::class, | ||
[ | ||
'resource' => $resource, | ||
] | ||
); | ||
$this->assertInstanceOf(Collection::class, $collection->addValuesToResult()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.