Skip to content

Commit

Permalink
Merge pull request #373 from magento-falcons/MAGETWO-58280
Browse files Browse the repository at this point in the history
Bug fixes:
* MAGETWO-57755: [GITHUB] Magento 2.0.x and 2.1.x does not respect table prefix during installation #5688
* MAGETWO-58081: [GitHub] Magento2 SSL Installation httpss:// #6262
* MAGETWO-57743: Fix Catalog integration tests on Travis CI
  • Loading branch information
magicbunneh authored Sep 13, 2016
2 parents 8bf902a + b181c2c commit 83f4f2e
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -567,4 +567,13 @@ protected function getProductEntityLinkField()
}
return $this->productEntityLinkField;
}

/**
* Clean cached values
*/
public function __destruct()
{
self::$attributeCodeToId = [];
self::$commonAttributesCache = [];
}
}
4 changes: 2 additions & 2 deletions setup/pub/magento/setup/web-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ angular.module('web-configuration', ['ngStorage'])

$scope.$watch('config.address.base_url', function() {
if (angular.equals($scope.config.https.text, '') || angular.isUndefined($scope.config.https.text)) {
$scope.config.https.text = $scope.config.address.base_url.replace('http', 'https');
$scope.config.https.text = $scope.config.address.base_url.replace('http://', 'https://');
}
});

$scope.populateHttps = function() {
$scope.config.https.text = $scope.config.address.base_url.replace('http', 'https');
$scope.config.https.text = $scope.config.address.base_url.replace('http://', 'https://');
};

$scope.showEncryptKey = function() {
Expand Down
4 changes: 2 additions & 2 deletions setup/src/Magento/Setup/Module/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getIdxName(
$indexType = '',
$connectionName = ResourceConnection::DEFAULT_CONNECTION
) {
return $this->getConnection($connectionName)->getIndexName($tableName, $fields, $indexType);
return $this->getConnection($connectionName)->getIndexName($this->getTable($tableName), $fields, $indexType);
}

/**
Expand All @@ -46,7 +46,7 @@ public function getFkName(
$connectionName = ResourceConnection::DEFAULT_CONNECTION
) {
return $this->getConnection($connectionName)->getForeignKeyName(
$priTableName,
$this->getTable($priTableName),
$priColumnName,
$refTableName,
$refColumnName
Expand Down
28 changes: 22 additions & 6 deletions setup/src/Magento/Setup/Test/Unit/Module/SetupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

namespace Magento\Setup\Test\Unit\Module;

use \Magento\Setup\Module\Setup;
use Magento\Framework\App\ResourceConnection;
use Magento\Setup\Module\Setup;

class SetupTest extends \PHPUnit_Framework_TestCase
{
Expand All @@ -22,19 +23,24 @@ class SetupTest extends \PHPUnit_Framework_TestCase
*/
private $setup;

/**
* @var ResourceConnection|\PHPUnit_Framework_MockObject_MockObject
*/
private $resourceModelMock;

protected function setUp()
{
$resourceModel = $this->getMock(\Magento\Framework\App\ResourceConnection::class, [], [], '', false);
$this->resourceModelMock = $this->getMock(ResourceConnection::class, [], [], '', false);
$this->connection = $this->getMockForAbstractClass(\Magento\Framework\DB\Adapter\AdapterInterface::class);
$resourceModel->expects($this->any())
$this->resourceModelMock->expects($this->any())
->method('getConnection')
->with(self::CONNECTION_NAME)
->will($this->returnValue($this->connection));
$resourceModel->expects($this->any())
$this->resourceModelMock->expects($this->any())
->method('getConnectionByName')
->with(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION)
->with(ResourceConnection::DEFAULT_CONNECTION)
->willReturn($this->connection);
$this->setup = new Setup($resourceModel, self::CONNECTION_NAME);
$this->setup = new Setup($this->resourceModelMock, self::CONNECTION_NAME);
}

public function testGetIdxName()
Expand All @@ -44,6 +50,11 @@ public function testGetIdxName()
$indexType = 'index_type';
$expectedIdxName = 'idxName';

$this->resourceModelMock->expects($this->once())
->method('getTableName')
->with($tableName)
->will($this->returnValue($tableName));

$this->connection->expects($this->once())
->method('getIndexName')
->with($tableName, $fields, $indexType)
Expand All @@ -59,6 +70,11 @@ public function testGetFkName()
$columnName = 'columnName';
$refColumnName = 'refColumnName';

$this->resourceModelMock->expects($this->once())
->method('getTableName')
->with($tableName)
->will($this->returnValue($tableName));

$this->connection->expects($this->once())
->method('getForeignKeyName')
->with($tableName, $columnName, $refTable, $refColumnName)
Expand Down
14 changes: 12 additions & 2 deletions setup/view/magento/setup/web-configuration.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,17 @@ $hints = [
ng-init="config.address.auto_base_url = '<?php echo $this->autoBaseUrl ?>'; fillBaseURL();"
ng-blur="addSlash()"
ng-change="populateHttps()"
ng-pattern="/^(https?:\/\/).*$/"
tooltip-placement="right"
tooltip-html-unsafe="<?php echo $hints['base_url']; ?>"
tooltip-trigger="focus"
tooltip-append-to-body="true"
>
<div class="error-container">
<span ng-show="webconfig.base_url.$error.required || webconfig.base_url.$error.url">
<span ng-show="!webconfig.base_url.valid
|| webconfig.base_url.$error.required
|| webconfig.base_url.$error.url"
>
Please enter a valid base URL path. (ex: http://www.example.com/)
</span>
</div>
Expand Down Expand Up @@ -189,10 +193,16 @@ $hints = [
ng-class="{'invalid': webconfig.https.$invalid && webconfig.submitted}"
ng-if="config.https.front || config.https.admin"
ng-focus=""
ng-pattern="/^(https?:\/\/).*$/"
required
>
<div class="error-container">
<span ng-show="webconfig.https.$error.required || webconfig.https.$error.url">Please enter a valid HTTPS base URL path. (ex: https://www.example.com/)</span>
<span ng-show="!webconfig.https.$error.valid
|| webconfig.https.$error.required
|| webconfig.https.$error.url"
>
Please enter a valid HTTPS base URL path. (ex: https://www.example.com/)
</span>
</div>
</div>
</div>
Expand Down

0 comments on commit 83f4f2e

Please sign in to comment.