-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28d2949
commit d76a35e
Showing
27 changed files
with
277 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
### Checklist | ||
- [ ] Pull request has a meaningful description of its purpose | ||
- [ ] All commits are accompanied by meaningful commit messages | ||
- [ ] Tests have been ran / updated |
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/.idea | ||
/vendor/ | ||
dev/instances/magento* | ||
dev/output/actual/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
list: # Lists all available commands, the default command when running `make` with no arguments | ||
grep -v -e "^\t" Makefile | grep . | awk -F":.+?#" '{ print $$1 " #" $$2 }' | column -t -s '#' | ||
|
||
configure-magento-2-1: # Install magento 2.1 with the test module, and create vendor.patch for analysis | ||
./setup-magento-with-diff.sh 2.1.13 2.1.16 21 | ||
|
||
test-magento-2-1: # Analyse 2.1 with vendor.patch | ||
php ../bin/patch-helper.php analyse $(shell pwd)/instances/magento21 > output/actual/magento21.out.txt | ||
diff output/expected/magento21.out.txt output/actual/magento21.out.txt | ||
|
||
configure-magento-2-2: # Install magento 2.2 with the test module, and create vendor.patch for analysis | ||
./setup-magento-with-diff.sh 2.2.5 2.2.6 22 | ||
|
||
test-magento-2-2: # Analyse 2.2 with vendor.patch | ||
php ../bin/patch-helper.php analyse $(shell pwd)/instances/magento22 > output/actual/magento22.out.txt | ||
diff output/expected/magento22.out.txt output/actual/magento22.out.txt |
7 changes: 7 additions & 0 deletions
7
dev/TestModule/app/code/Ampersand/Test/Model/Admin/Directpost.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,7 @@ | ||
<?php | ||
namespace Ampersand\Test\Model\Export; | ||
|
||
class Directpost extends \Magento\Authorizenet\Model\Directpost | ||
{ | ||
//todo detect this | ||
} |
7 changes: 7 additions & 0 deletions
7
dev/TestModule/app/code/Ampersand/Test/Model/Admin/Export/AdvancedPricing.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,7 @@ | ||
<?php | ||
namespace Ampersand\Test\Model\Admin\Export; | ||
|
||
class AdvancedPricing extends \Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing | ||
{ | ||
//todo detect this | ||
} |
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,7 @@ | ||
<?php | ||
namespace Ampersand\Test\Model; | ||
|
||
class Directpost extends \Magento\Authorizenet\Model\Directpost | ||
{ | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
dev/TestModule/app/code/Ampersand/Test/Model/Export/AdvancedPricing.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,7 @@ | ||
<?php | ||
namespace Ampersand\Test\Model\Export; | ||
|
||
class AdvancedPricing extends \Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing | ||
{ | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
dev/TestModule/app/code/Ampersand/Test/Setup/UpgradeData.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,56 @@ | ||
<?php | ||
|
||
namespace Ampersand\Test\Setup; | ||
|
||
use Magento\Framework\App\Cache; | ||
use Magento\Framework\Setup\ModuleContextInterface; | ||
use Magento\Framework\Setup\ModuleDataSetupInterface; | ||
use Magento\Framework\Setup\UpgradeDataInterface; | ||
use Magento\Theme\Model\Theme\ThemeProvider; | ||
use Magento\Theme\Model\Config as ThemeConfig; | ||
use Magento\Theme\Model\ThemeFactory as ThemeFactory; | ||
|
||
class UpgradeData implements UpgradeDataInterface | ||
{ | ||
/** @var \Magento\Theme\Model\Theme\ThemeProvider */ | ||
private $themeProvider; | ||
/** @var \Magento\Theme\Model\Config */ | ||
private $themeConfig; | ||
/** @var \Magento\Theme\Model\ThemeFactory */ | ||
private $themeFactory; | ||
/** @var \Magento\Framework\App\Cache */ | ||
private $cache; | ||
|
||
/** | ||
* @param \Magento\Theme\Model\Theme\ThemeProvider $themeProvider | ||
* @param \Magento\Theme\Model\Config $themeConfig | ||
* @param \Magento\Framework\App\Cache $cache | ||
*/ | ||
public function __construct( | ||
ThemeProvider $themeProvider, | ||
ThemeConfig $themeConfig, | ||
ThemeFactory $themeFactory, | ||
Cache $cache | ||
) { | ||
$this->themeProvider = $themeProvider; | ||
$this->themeConfig = $themeConfig; | ||
$this->themeFactory = $themeFactory; | ||
$this->cache = $cache; | ||
} | ||
|
||
/** | ||
* Upgrades data for a module | ||
* @param ModuleDataSetupInterface $setup | ||
* @param ModuleContextInterface $context | ||
* @return void | ||
*/ | ||
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) | ||
{ | ||
if (version_compare($context->getVersion(), '1.0.0', '<')) { | ||
/** @var \Magento\Theme\Model\Theme $theme */ | ||
$theme = $this->themeProvider->getThemeByFullPath('frontend/Ampersand/theme'); | ||
$this->themeConfig->assignToStore($theme, [1]); | ||
$this->cache->clean(); | ||
} | ||
} | ||
} |
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,5 @@ | ||
<?xml version="1.0"?> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | ||
<preference for="Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing" type="Ampersand\Test\Model\Admin\Export\AdvancedPricing" /> | ||
<preference for="Magento\Authorizenet\Model\Directpost" type="Ampersand\Test\Model\Admin\Directpost" /> | ||
</config> |
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,5 @@ | ||
<?xml version="1.0"?> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | ||
<preference for="Magento\AdvancedPricingImportExport\Model\Export\AdvancedPricing" type="Ampersand\Test\Model\Export\AdvancedPricing" /> | ||
<preference for="Magento\Authorizenet\Model\Directpost" type="Ampersand\Test\Model\Directpost" /> | ||
</config> |
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,10 @@ | ||
<?xml version="1.0"?> | ||
|
||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> | ||
<module name="Ampersand_Test" active="true" setup_version="1.0.0"> | ||
<sequence> | ||
<module name="Magento_AdvancedPricing"/> | ||
<module name="Magento_Theme"/> | ||
</sequence> | ||
</module> | ||
</config> |
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,7 @@ | ||
<?php | ||
use Magento\Framework\Component\ComponentRegistrar; | ||
|
||
$registrar = new ComponentRegistrar(); | ||
if ($registrar->getPath(ComponentRegistrar::MODULE, 'Ampersand_Test') === null) { | ||
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Ampersand_Test', __DIR__); | ||
} |
Empty file.
Empty file.
Empty file.
10 changes: 10 additions & 0 deletions
10
dev/TestModule/app/design/frontend/Ampersand/theme/etc/view.xml
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,10 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd"> | ||
|
||
</view> |
9 changes: 9 additions & 0 deletions
9
dev/TestModule/app/design/frontend/Ampersand/theme/registration.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,9 @@ | ||
<?php | ||
|
||
\Magento\Framework\Component\ComponentRegistrar::register( | ||
\Magento\Framework\Component\ComponentRegistrar::THEME, | ||
'frontend/Ampersand/theme', | ||
__DIR__ | ||
); | ||
|
||
|
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,5 @@ | ||
<?xml version="1.0"?> | ||
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd"> | ||
<title>Ampersand Theme</title> | ||
<parent>Magento/luma</parent> | ||
</theme> |
Empty file.
Empty file.
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,16 @@ | ||
+---------------------------------------------------------+---------------------------------+ | ||
| Core file | Preference | | ||
+---------------------------------------------------------+---------------------------------+ | ||
| vendor/magento/module-authorizenet/Model/Directpost.php | Ampersand\Test\Model\Directpost | | ||
+---------------------------------------------------------+---------------------------------+ | ||
+-------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | ||
| Core file | Override (phtml/js) | | ||
+-------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | ||
| vendor/magento/module-customer/view/frontend/templates/account/dashboard/info.phtml | app/design/frontend/Ampersand/theme/Magento_Customer/templates/account/dashboard/info.phtml | | ||
| vendor/magento/module-customer/view/frontend/web/js/model/authentication-popup.js | app/design/frontend/Ampersand/theme/Magento_Customer/web/js/model/authentication-popup.js | | ||
+-------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | ||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------+ | ||
| Core file | Override/extended (layout xml) | | ||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------+ | ||
| vendor/magento/module-sales/view/frontend/layout/sales_order_print.xml | app/design/frontend/Ampersand/theme/Magento_Sales/layout/sales_order_print.xml | | ||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------+ |
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,17 @@ | ||
+---------------------------------------------------------------------------------------+---------------------------------------------+ | ||
| Core file | Preference | | ||
+---------------------------------------------------------------------------------------+---------------------------------------------+ | ||
| vendor/magento/module-advanced-pricing-import-export/Model/Export/AdvancedPricing.php | Ampersand\Test\Model\Export\AdvancedPricing | | ||
| vendor/magento/module-authorizenet/Model/Directpost.php | Ampersand\Test\Model\Directpost | | ||
+---------------------------------------------------------------------------------------+---------------------------------------------+ | ||
+-------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | ||
| Core file | Override (phtml/js) | | ||
+-------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | ||
| vendor/magento/module-customer/view/frontend/templates/account/dashboard/info.phtml | app/design/frontend/Ampersand/theme/Magento_Customer/templates/account/dashboard/info.phtml | | ||
| vendor/magento/module-customer/view/frontend/web/js/model/authentication-popup.js | app/design/frontend/Ampersand/theme/Magento_Customer/web/js/model/authentication-popup.js | | ||
+-------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+ | ||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------+ | ||
| Core file | Override/extended (layout xml) | | ||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------+ | ||
| vendor/magento/module-sales/view/frontend/layout/sales_order_print.xml | app/design/frontend/Ampersand/theme/Magento_Sales/layout/sales_order_print.xml | | ||
+------------------------------------------------------------------------+--------------------------------------------------------------------------------+ |
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,43 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
FROM=$1 | ||
TO=$2 | ||
ID=$3 | ||
|
||
#rm -rf ./instances/magento$ID | ||
#mysql -hlocalhost -uroot -e "drop database testmagento$ID;" | ||
mysql -hlocalhost -uroot -e "create database testmagento$ID;" | ||
|
||
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=$FROM ./instances/magento$ID/ | ||
cd instances/magento$ID/ | ||
composer install | ||
|
||
# Backup vendor and upgrade magento | ||
mv vendor/ vendor_orig/ | ||
composer install | ||
composer require magento/product-community-edition $TO --no-update | ||
composer update composer/composer magento/product-community-edition --with-dependencies | ||
composer install | ||
|
||
# Install test module and theme | ||
cd - | ||
cp -r TestModule/app/code ./instances/magento$ID/app/ | ||
cp -r TestModule/app/design/frontend/Ampersand ./instances/magento$ID/app/design/frontend/ | ||
cd - | ||
|
||
# Install magento | ||
php -d memory_limit=1024M bin/magento setup:install \ | ||
--admin-firstname=ampersand --admin-lastname=developer [email protected] \ | ||
--admin-user=admin --admin-password=somepass123 \ | ||
--db-name=testmagento$ID --db-user=root --db-host=127.0.0.1\ | ||
--backend-frontname=admin \ | ||
--base-url=https://magento-$ID-develop.localhost/ \ | ||
--language=en_GB --currency=GBP --timezone=Europe/London \ | ||
--use-rewrites=1; | ||
|
||
# Generate patch file for analysis | ||
diff -ur vendor_orig/ vendor/ > vendor.patch || true | ||
|
||
cd - | ||
set +e |
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