File tree Expand file tree Collapse file tree 11 files changed +226
-3
lines changed Expand file tree Collapse file tree 11 files changed +226
-3
lines changed Original file line number Diff line number Diff line change 1+ /.gitattributes export-ignore
2+ /.gitignore export-ignore
3+ /composer.json export-ignore
4+ /.travis.yml export-ignore
5+ /.travis export-ignore
6+ /tests export-ignore
7+ /auth.json export-ignore
Original file line number Diff line number Diff line change 1+ /vendor
Original file line number Diff line number Diff line change 1+ os : linux
2+ dist : trusty
3+ group : edge
4+ addons :
5+ apt :
6+ packages :
7+ - mysql-server-5.6
8+ - mysql-client-core-5.6
9+ - mysql-client-5.6
10+ - postfix
11+ hosts :
12+ - magento2.travis
13+ language : php
14+ jobs :
15+ include :
16+ - php : 7.3
17+ env :
18+ - MAGENTO_VERSION=2.3
19+ - TEST_SUITE=integration
20+ - php : 7.3
21+ env :
22+ - MAGENTO_VERSION=2.4-develop
23+ - TEST_SUITE=integration
24+ - php : 7.2
25+ env :
26+ - MAGENTO_VERSION=2.3
27+ - TEST_SUITE=integration
28+ - php : 7.2
29+ env :
30+ - MAGENTO_VERSION=2.4-develop
31+ - TEST_SUITE=integration
32+ env :
33+ global :
34+ - COMPOSER_BIN_DIR=~/bin
35+ - COMPOSER_PACKAGE_NAME=integer-net/magento2-global-custom-layout
36+ cache :
37+ apt : true
38+ directories :
39+ - $HOME/.composer/cache
40+ before_script : ./.travis/before_script.sh
41+ script : phpunit -c magento2/dev/tests/$TEST_SUITE --coverage-text --coverage-clover=/tmp/coverage.clover
42+ after_script :
43+ - |
44+ wget https://scrutinizer-ci.com/ocular.phar
45+ php ocular.phar code-coverage:upload --format=php-clover /tmp/coverage.clover
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+ trap ' >&2 echo Error: Command \`$BASH_COMMAND\` on line $LINENO failed with exit code $?' ERR
5+
6+ # mock mail
7+ sudo service postfix stop
8+ echo # print a newline
9+ smtp-sink -d " %d.%H.%M.%S" localhost:2500 1000 &
10+ echo ' sendmail_path = "/usr/sbin/sendmail -t -i "' > ~ /.phpenv/versions/$( phpenv version-name) /etc/conf.d/sendmail.ini
11+
12+ # adjust memory limit
13+ echo ' memory_limit = -1' >> ~ /.phpenv/versions/$( phpenv version-name) /etc/conf.d/travis.ini
14+ phpenv rehash;
15+
16+ composer selfupdate
17+
18+ # clone main magento github repository
19+ git clone --branch $MAGENTO_VERSION --depth=1 https://github.com/magento/magento2
20+
21+ # install Magento
22+ cd magento2
23+
24+ # add composer package under test, composer require will trigger update/install
25+ composer config minimum-stability dev
26+ composer config repositories.travis_to_test git https://github.com/$TRAVIS_REPO_SLUG .git
27+ # TODO make it work with tags as well:
28+ composer require ${COMPOSER_PACKAGE_NAME} :dev-${TRAVIS_BRANCH} \# {$TRAVIS_COMMIT }
29+
30+ # prepare for test suite
31+ case $TEST_SUITE in
32+ integration)
33+ cp vendor/$COMPOSER_PACKAGE_NAME /tests/Integration/phpunit.xml.dist dev/tests/integration/phpunit.xml
34+
35+ cd dev/tests/integration
36+
37+ # create database and move db config into place
38+ mysql -uroot -e '
39+ SET @@global.sql_mode = NO_ENGINE_SUBSTITUTION;
40+ CREATE DATABASE magento_integration_tests;
41+ '
42+ cp etc/install-config-mysql.travis.php.dist etc/install-config-mysql.php
43+ sed -i ' /amqp/d' etc/install-config-mysql.php
44+
45+ cd ../../..
46+ ;;
47+ unit)
48+ cp vendor/$COMPOSER_PACKAGE_NAME /tests/Unit/phpunit.xml.dist dev/tests/unit/phpunit.xml
49+ ;;
50+ esac
Original file line number Diff line number Diff line change 22
33[ ![ Latest Version on Packagist] [ ico-version ]] [ link-packagist ]
44[ ![ Software License] [ ico-license ]] ( LICENSE.md )
5+ [ ![ Build Status] [ ico-travis ]] [ link-travis ]
6+ [ ![ Coverage Status] [ ico-scrutinizer ]] [ link-scrutinizer ]
7+ [ ![ Quality Score] [ ico-code-quality ]] [ link-code-quality ]
58
69Allows you to add global layout update files to be selected from admin, by using ` 0 ` instead of a ` category_id ` / ` sku ` / ` url_path ` .
710
@@ -69,7 +72,13 @@ The MIT License (MIT). Please see [License File](LICENSE.txt) for more informati
6972
7073[ico-version]: https://img.shields.io/packagist/v/integer-net/magento2-global-custom-layout.svg?style=flat-square
7174[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
75+ [ico-travis]: https://img.shields.io/travis/integer-net/magento2-global-custom-layout/master.svg?style=flat-square
76+ [ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/integer-net/magento2-global-custom-layout.svg?style=flat-square
77+ [ico-code-quality]: https://img.shields.io/scrutinizer/g/integer-net/magento2-global-custom-layout.svg?style=flat-square
7278
7379[link-packagist]: https://packagist.org/packages/integer-net/magento2-global-custom-layout
80+ [link-travis]: https://travis-ci.org/integer-net/magento2-global-custom-layout
81+ [link-scrutinizer]: https://scrutinizer-ci.com/g/integer-net/magento2-global-custom-layout/code-structure
82+ [link-code-quality]: https://scrutinizer-ci.com/g/integer-net/magento2-global-custom-layout
7483[link-author]: https://github.com/wigman
7584[link-contributors]: ../../contributors
Original file line number Diff line number Diff line change 1+ {
2+ "http-basic" : {
3+ "repo.magento.com" : {
4+ "username" : " 438956769d577f67f247510ffa624225" ,
5+ "password" : " b5d1664bb6ee2d27ec75dd36d6a2ac4e"
6+ }
7+ }
8+ }
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ public function afterFetchAvailableFiles(
9999
100100 return array_merge ($ result , array_filter (
101101 array_map (
102- function (string $ handle ) use ($ category ) : ?string {
102+ function (string $ handle ) use ($ category ) : ?string {
103103 preg_match (
104104 '/^catalog\_category\_view\_selectable\_0\_([a-z0-9]+)/i ' ,
105105 $ handle ,
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ public function afterFetchAvailableFiles(
110110
111111 return array_filter (
112112 array_map (
113- function (string $ handle ) : ?string {
113+ function (string $ handle ) : ?string {
114114 preg_match (
115115 '/^cms\_page\_view\_selectable\_0\_([a-z0-9]+)/i ' ,
116116 $ handle ,
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ public function afterFetchAvailableFiles(
9797
9898 return array_filter (
9999 array_map (
100- function (string $ handle ) : ?string {
100+ function (string $ handle ) : ?string {
101101 preg_match (
102102 '/^catalog\_product\_view\_selectable\_0\_([a-z0-9]+)/i ' ,
103103 $ handle ,
Original file line number Diff line number Diff line change 1+ <?php
2+ declare (strict_types=1 );
3+
4+ namespace IntegerNet \GlobalCustomLayout \Test \Integration ;
5+
6+ use Magento \Framework \App \ObjectManager ;
7+ use Magento \Framework \Module \ModuleList ;
8+ use PHPUnit \Framework \TestCase ;
9+
10+ class ModuleTest extends TestCase
11+ {
12+ private const MODULE_NAME = 'IntegerNet_GlobalCustomLayout ' ;
13+
14+ /**
15+ * @var ObjectManager
16+ */
17+ private $ objectManager ;
18+
19+ protected function setUp ()
20+ {
21+ $ this ->objectManager = ObjectManager::getInstance ();
22+ }
23+
24+ public function testModuleIsActive ()
25+ {
26+ /** @var ModuleList $moduleList */
27+ $ moduleList = $ this ->objectManager ->create (ModuleList::class);
28+ $ this ->assertTrue (
29+ $ moduleList ->has (self ::MODULE_NAME ),
30+ sprintf ('The module %s should be enabled ' , self ::MODULE_NAME )
31+ );
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments