Merge pull request #1548 from mailpoet/php-deps-update
PHP Dependencies update [MAILPOET-1542]
This commit is contained in:
@ -3,7 +3,7 @@ jobs:
|
|||||||
build_and_code_qa:
|
build_and_code_qa:
|
||||||
working_directory: /home/circleci/mailpoet
|
working_directory: /home/circleci/mailpoet
|
||||||
docker:
|
docker:
|
||||||
- image: mailpoet/wordpress:7.1_20180417.1
|
- image: mailpoet/wordpress:7.1_20181009.1
|
||||||
environment:
|
environment:
|
||||||
TZ: /usr/share/zoneinfo/Etc/UTC
|
TZ: /usr/share/zoneinfo/Etc/UTC
|
||||||
steps:
|
steps:
|
||||||
@ -134,7 +134,7 @@ jobs:
|
|||||||
php7:
|
php7:
|
||||||
working_directory: /home/circleci/mailpoet
|
working_directory: /home/circleci/mailpoet
|
||||||
docker:
|
docker:
|
||||||
- image: mailpoet/wordpress:7.1_20180417.1
|
- image: mailpoet/wordpress:7.1_20181009.1
|
||||||
- image: circleci/mysql:5.7
|
- image: circleci/mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
TZ: /usr/share/zoneinfo/Etc/UTC
|
TZ: /usr/share/zoneinfo/Etc/UTC
|
||||||
@ -165,7 +165,7 @@ jobs:
|
|||||||
php7_multisite:
|
php7_multisite:
|
||||||
working_directory: /home/circleci/mailpoet
|
working_directory: /home/circleci/mailpoet
|
||||||
docker:
|
docker:
|
||||||
- image: mailpoet/wordpress:7.1_20180417.1
|
- image: mailpoet/wordpress:7.1_20181009.1
|
||||||
- image: circleci/mysql:5.7
|
- image: circleci/mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
TZ: /usr/share/zoneinfo/Etc/UTC
|
TZ: /usr/share/zoneinfo/Etc/UTC
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM mailpoet/wordpress:5.6-cli_20180417.1
|
FROM mailpoet/wordpress:5.6-cli_20181009.1
|
||||||
|
|
||||||
ENV COMPOSER_ALLOW_SUPERUSER=1
|
ENV COMPOSER_ALLOW_SUPERUSER=1
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.5",
|
"php": ">=5.5",
|
||||||
"twig/twig": "1.*",
|
"twig/twig": "1.*",
|
||||||
"cerdic/css-tidy": "^1.5.5",
|
"cerdic/css-tidy": "^1.6",
|
||||||
"tburry/pquery": "^1.1.1",
|
"tburry/pquery": "^1.1.1",
|
||||||
"j4mie/paris": "1.5.6",
|
"j4mie/paris": "1.5.6",
|
||||||
"swiftmailer/swiftmailer": "dev-tls",
|
"swiftmailer/swiftmailer": "dev-tls",
|
||||||
@ -20,9 +20,9 @@
|
|||||||
"nesbot/carbon": "^1.21",
|
"nesbot/carbon": "^1.21",
|
||||||
"soundasleep/html2text": "dev-master",
|
"soundasleep/html2text": "dev-master",
|
||||||
"sabberworm/php-css-parser": "^8.1",
|
"sabberworm/php-css-parser": "^8.1",
|
||||||
"symfony/polyfill-php72": "^1.8",
|
"symfony/polyfill-php72": "^1.9",
|
||||||
"symfony/polyfill-mbstring": "1.8.0",
|
"symfony/polyfill-mbstring": "^1.9",
|
||||||
"sensiolabs/security-checker": "^4.1",
|
"sensiolabs/security-checker": "^5.0",
|
||||||
"monolog/monolog": "^1.23"
|
"monolog/monolog": "^1.23"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
@ -32,13 +32,13 @@
|
|||||||
"codeception/verify": "^0.4.0",
|
"codeception/verify": "^0.4.0",
|
||||||
"consolidation/robo": "^1.3.0",
|
"consolidation/robo": "^1.3.0",
|
||||||
"henrikbjorn/lurker": "^1.2",
|
"henrikbjorn/lurker": "^1.2",
|
||||||
"lucatume/wp-browser": "1.21.23",
|
"lucatume/wp-browser": "1.24.5",
|
||||||
"phpunit/phpunit": "5.7.27",
|
"phpunit/phpunit": "5.7.27",
|
||||||
"vlucas/phpdotenv": "^2.4.0",
|
"vlucas/phpdotenv": "^2.4.0",
|
||||||
"umpirsky/twig-gettext-extractor": "1.1.*",
|
"umpirsky/twig-gettext-extractor": "1.1.*",
|
||||||
"kint-php/kint": "^2.2",
|
"kint-php/kint": "^3.0",
|
||||||
"squizlabs/php_codesniffer": "^2.8.1",
|
"squizlabs/php_codesniffer": "^3.3",
|
||||||
"wimg/php-compatibility": "^7.1.2",
|
"phpcompatibility/php-compatibility": "^9.0",
|
||||||
"coenjacobs/mozart": "^0.2.2"
|
"coenjacobs/mozart": "^0.2.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -48,8 +48,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"post-update-cmd": "\"vendor/bin/mozart\" compose; rm -rf vendor/monolog; rm -rf vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility; cp -rp vendor/wimg/php-compatibility vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility",
|
"post-update-cmd": "\"vendor/bin/mozart\" compose; rm -rf vendor/monolog",
|
||||||
"post-install-cmd": "\"vendor/bin/mozart\" compose; rm -rf vendor/monolog; rm -rf vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility; cp -rp vendor/wimg/php-compatibility vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PHPCompatibility"
|
"post-install-cmd": "\"vendor/bin/mozart\" compose; rm -rf vendor/monolog"
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"mozart": {
|
"mozart": {
|
||||||
|
585
composer.lock
generated
585
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -75,13 +75,17 @@ class Capabilities {
|
|||||||
function registerMembersCapabilities() {
|
function registerMembersCapabilities() {
|
||||||
$permissions = AccessControl::getPermissionLabels();
|
$permissions = AccessControl::getPermissionLabels();
|
||||||
foreach($permissions as $name => $label) {
|
foreach($permissions as $name => $label) {
|
||||||
members_register_cap(
|
$this->registerMembersCapability($name, $label);
|
||||||
$name,
|
|
||||||
array(
|
|
||||||
'label' => $label,
|
|
||||||
'group' => self::MEMBERS_CAP_GROUP_NAME
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function registerMembersCapability($name, $label) {
|
||||||
|
members_register_cap(
|
||||||
|
$name,
|
||||||
|
array(
|
||||||
|
'label' => $label,
|
||||||
|
'group' => self::MEMBERS_CAP_GROUP_NAME
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ EOL;
|
|||||||
<?php
|
<?php
|
||||||
foreach($forms as $form) {
|
foreach($forms as $form) {
|
||||||
$is_selected = ($selected_form === (int)$form['id']) ? 'selected="selected"' : '';
|
$is_selected = ($selected_form === (int)$form['id']) ? 'selected="selected"' : '';
|
||||||
?>
|
?>
|
||||||
<option value="<?php echo (int)$form['id']; ?>" <?php echo $is_selected; ?>><?php echo esc_html($form['name']); ?></option>
|
<option value="<?php echo (int)$form['id']; ?>" <?php echo $is_selected; ?>><?php echo esc_html($form['name']); ?></option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
* @link http://pear.php.net/package/PHP_CodeSniffer
|
* @link http://pear.php.net/package/PHP_CodeSniffer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (class_exists('PHP_CodeSniffer_Standards_AbstractPatternSniff', true) === false) {
|
if (class_exists('PHP_CodeSniffer\Sniffs\AbstractPatternSniff', true) === false) {
|
||||||
throw new PHP_CodeSniffer_Exception('Class PHP_CodeSniffer_Standards_AbstractPatternSniff not found');
|
throw new \PHP_CodeSniffer\Exceptions\RuntimeException('Class PHP_CodeSniffer\Sniffs\AbstractPatternSniff not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,7 +29,7 @@ if (class_exists('PHP_CodeSniffer_Standards_AbstractPatternSniff', true) === fal
|
|||||||
* @version Release: @package_version@
|
* @version Release: @package_version@
|
||||||
* @link http://pear.php.net/package/PHP_CodeSniffer
|
* @link http://pear.php.net/package/PHP_CodeSniffer
|
||||||
*/
|
*/
|
||||||
class MailPoet_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer_Standards_AbstractPatternSniff {
|
class MailPoet_Sniffs_ControlStructures_ControlSignatureSniff extends PHP_CodeSniffer\Sniffs\AbstractPatternSniff {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If true, comments will be ignored if they are found in the code.
|
* If true, comments will be ignored if they are found in the code.
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<ruleset name="MailPoet">
|
<ruleset name="MailPoet">
|
||||||
|
<config name="installed_paths" value="vendor/squizlabs/php_codesniffer,vendor/phpcompatibility/php-compatibility"/>
|
||||||
<description>MailPoet specific rule set</description>
|
<description>MailPoet specific rule set</description>
|
||||||
|
|
||||||
<!-- Control structures must have at least one statement in the body -->
|
<!-- Control structures must have at least one statement in the body -->
|
||||||
@ -118,7 +119,7 @@
|
|||||||
<rule ref="Squiz.Scope.StaticThisUsage"/>
|
<rule ref="Squiz.Scope.StaticThisUsage"/>
|
||||||
|
|
||||||
<!-- Remove space between if/for/while and opening parenthesis -->
|
<!-- Remove space between if/for/while and opening parenthesis -->
|
||||||
<rule ref="MailPoet.ControlStructures.ControlSignature"/>
|
<rule ref="MailPoet.ControlStructures.ControlSignature" />
|
||||||
|
|
||||||
<!-- Run against the PHPCompatibility ruleset -->
|
<!-- Run against the PHPCompatibility ruleset -->
|
||||||
<rule ref="PHPCompatibility" />
|
<rule ref="PHPCompatibility" />
|
||||||
|
@ -94,17 +94,6 @@ class CapabilitiesTest extends \MailPoetTest {
|
|||||||
expect(is_callable(WPHooksHelper::getActionAdded($hook_name)[0]))->true();
|
expect(is_callable(WPHooksHelper::getActionAdded($hook_name)[0]))->true();
|
||||||
}
|
}
|
||||||
|
|
||||||
function testItRegistersMembersCapGroup() {
|
|
||||||
if(function_exists('members_register_cap_group')) { // Members plugin active
|
|
||||||
$this->caps->registerMembersCapGroup();
|
|
||||||
expect_that(members_cap_group_exists(Capabilities::MEMBERS_CAP_GROUP_NAME));
|
|
||||||
} else {
|
|
||||||
$func = Mock::func('MailPoet\Config', 'members_register_cap_group', true);
|
|
||||||
$this->caps->registerMembersCapGroup();
|
|
||||||
$func->verifyInvoked([Capabilities::MEMBERS_CAP_GROUP_NAME]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function testItRegistersMembersCapabilities() {
|
function testItRegistersMembersCapabilities() {
|
||||||
$permissions = AccessControl::getPermissionLabels();
|
$permissions = AccessControl::getPermissionLabels();
|
||||||
$permission_count = count($permissions);
|
$permission_count = count($permissions);
|
||||||
@ -113,9 +102,13 @@ class CapabilitiesTest extends \MailPoetTest {
|
|||||||
expect(members_get_cap_group(Capabilities::MEMBERS_CAP_GROUP_NAME)->caps)
|
expect(members_get_cap_group(Capabilities::MEMBERS_CAP_GROUP_NAME)->caps)
|
||||||
->count($permission_count);
|
->count($permission_count);
|
||||||
} else {
|
} else {
|
||||||
$func = Mock::func('MailPoet\Config', 'members_register_cap', true);
|
$caps = Stub::makeEmptyExcept(
|
||||||
$this->caps->registerMembersCapabilities();
|
$this->caps,
|
||||||
$func->verifyInvokedMultipleTimes($permission_count);
|
'registerMembersCapabilities',
|
||||||
|
array('registerMembersCapability' => Expected::exactly($permission_count)),
|
||||||
|
$this
|
||||||
|
);
|
||||||
|
$caps->registerMembersCapabilities();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user