From b7861e3f65e220b1adbb1b9fe41fb7fc06ede0e1 Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Mon, 3 Aug 2020 14:03:30 -0400 Subject: [PATCH] jetpack connector test updated --- composer.json | 14 +- composer.lock | 612 +++++++++++++++--- phpunit.xml | 6 + tests/bootstrap.php | 27 + .../test-class-connector-jetpack.php | 184 ++++++ 5 files changed, 750 insertions(+), 93 deletions(-) create mode 100644 tests/tests/connectors/test-class-connector-jetpack.php diff --git a/composer.json b/composer.json index 0a51aa054..f20af5344 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,12 @@ "homepage": "https://wordpress.org/plugins/stream/", "type": "wordpress-plugin", "license": "GPL-2.0-or-later", + "repositories": [ + { + "type":"composer", + "url":"https://wpackagist.org" + } + ], "require": { "composer/installers": "~1.0" }, @@ -15,7 +21,8 @@ "wp-cli/wp-cli-bundle": "^2.2", "wp-coding-standards/wpcs": "^2.2", "wp-phpunit/wp-phpunit": "^5.4", - "wpsh/local": "^0.2.3" + "wpsh/local": "^0.2.3", + "wpackagist-plugin/jetpack": "^8.7" }, "config": { "process-timeout": 600, @@ -25,7 +32,10 @@ } }, "extra": { - "wordpress-install-dir": "local/public" + "wordpress-install-dir": "local/public", + "installer-paths": { + "local/public/wp-content/plugins/{$name}/": ["type:wordpress-plugin"] + } }, "scripts": { "release": [ diff --git a/composer.lock b/composer.lock index 58d193226..57a1788ff 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "74043f691d06bd00f61066eec761aa80", + "content-hash": "731031d5cca29fa663c1be5d5f7564cb", "packages": [ { "name": "composer/installers", @@ -137,30 +137,30 @@ "packages-dev": [ { "name": "automattic/vipwpcs", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "fc02f491dc9f51da7c32941ac579f70b9ed300c5" + "reference": "03e75ddd0261b675dece60fb67fc2e9c6af4ad35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/fc02f491dc9f51da7c32941ac579f70b9ed300c5", - "reference": "fc02f491dc9f51da7c32941ac579f70b9ed300c5", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/03e75ddd0261b675dece60fb67fc2e9c6af4ad35", + "reference": "03e75ddd0261b675dece60fb67fc2e9c6af4ad35", "shasum": "" }, "require": { - "php": ">=5.6", - "squizlabs/php_codesniffer": "^3.3.1", - "wp-coding-standards/wpcs": "^2.1" + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.5.5", + "wp-coding-standards/wpcs": "^2.3" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "phpcompatibility/php-compatibility": "^9", - "phpunit/phpunit": "^5 || ^6 || ^7" + "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will manage the PHPCS 'installed_paths' automatically." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -179,7 +179,7 @@ "standards", "wordpress" ], - "time": "2019-07-12T08:47:36+00:00" + "time": "2020-07-07T07:48:04+00:00" }, { "name": "composer/ca-bundle", @@ -239,16 +239,16 @@ }, { "name": "composer/composer", - "version": "1.10.8", + "version": "1.10.9", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "56e0e094478f30935e9128552188355fa9712291" + "reference": "83c3250093d5491600a822e176b107a945baf95a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/56e0e094478f30935e9128552188355fa9712291", - "reference": "56e0e094478f30935e9128552188355fa9712291", + "url": "https://api.github.com/repos/composer/composer/zipball/83c3250093d5491600a822e176b107a945baf95a", + "reference": "83c3250093d5491600a822e176b107a945baf95a", "shasum": "" }, "require": { @@ -315,7 +315,21 @@ "dependency", "package" ], - "time": "2020-06-24T19:23:30+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-07-16T10:57:00+00:00" }, { "name": "composer/semver", @@ -380,16 +394,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.3", + "version": "1.5.4", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "0c3e51e1880ca149682332770e25977c70cf9dae" + "reference": "6946f785871e2314c60b4524851f3702ea4f2223" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/0c3e51e1880ca149682332770e25977c70cf9dae", - "reference": "0c3e51e1880ca149682332770e25977c70cf9dae", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", + "reference": "6946f785871e2314c60b4524851f3702ea4f2223", "shasum": "" }, "require": { @@ -436,7 +450,21 @@ "spdx", "validator" ], - "time": "2020-02-14T07:44:31+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-07-15T15:35:07+00:00" }, { "name": "composer/xdebug-handler", @@ -1265,6 +1293,55 @@ ], "time": "2013-02-24T15:01:54+00:00" }, + { + "name": "paragonie/random_compat", + "version": "v2.0.18", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/0a58ef6e3146256cc3dc7cc393927bcc7d1b72db", + "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2019-01-03T20:59:08+00:00" + }, { "name": "php-coveralls/php-coveralls", "version": "v2.2.0", @@ -2698,16 +2775,16 @@ }, { "name": "seld/phar-utils", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0" + "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8800503d56b9867d43d9c303b9cbcc26016e82f0", - "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8674b1d84ffb47cc59a101f5d5a3b61e87d23796", + "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796", "shasum": "" }, "require": { @@ -2738,7 +2815,7 @@ "keywords": [ "phar" ], - "time": "2020-02-14T15:25:33+00:00" + "time": "2020-07-07T18:42:57+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -2793,16 +2870,16 @@ }, { "name": "symfony/config", - "version": "v3.4.42", + "version": "v3.4.43", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "cd61db31cbd19cbe4ba9f6968f13c9076e1372ab" + "reference": "9e2aa97f0d51f114983666f5aa362426d53e004a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/cd61db31cbd19cbe4ba9f6968f13c9076e1372ab", - "reference": "cd61db31cbd19cbe4ba9f6968f13c9076e1372ab", + "url": "https://api.github.com/repos/symfony/config/zipball/9e2aa97f0d51f114983666f5aa362426d53e004a", + "reference": "9e2aa97f0d51f114983666f5aa362426d53e004a", "shasum": "" }, "require": { @@ -2853,20 +2930,34 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2020-05-22T10:56:48+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-23T09:37:51+00:00" }, { "name": "symfony/console", - "version": "v3.4.42", + "version": "v3.4.43", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "bfe29ead7e7b1cc9ce74c6a40d06ad1f96fced13" + "reference": "afc7189694d2c59546cf24ea606a236fa46a966e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/bfe29ead7e7b1cc9ce74c6a40d06ad1f96fced13", - "reference": "bfe29ead7e7b1cc9ce74c6a40d06ad1f96fced13", + "url": "https://api.github.com/repos/symfony/console/zipball/afc7189694d2c59546cf24ea606a236fa46a966e", + "reference": "afc7189694d2c59546cf24ea606a236fa46a966e", "shasum": "" }, "require": { @@ -2925,20 +3016,34 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2020-05-30T18:58:05+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-06T08:57:31+00:00" }, { "name": "symfony/debug", - "version": "v3.4.42", + "version": "v3.4.43", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "518c6a00d0872da30bd06aee3ea59a0a5cf54d6d" + "reference": "7ce874f4432d8b11cc45a80cc5130a6e2609728d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/518c6a00d0872da30bd06aee3ea59a0a5cf54d6d", - "reference": "518c6a00d0872da30bd06aee3ea59a0a5cf54d6d", + "url": "https://api.github.com/repos/symfony/debug/zipball/7ce874f4432d8b11cc45a80cc5130a6e2609728d", + "reference": "7ce874f4432d8b11cc45a80cc5130a6e2609728d", "shasum": "" }, "require": { @@ -2981,11 +3086,25 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2020-05-22T18:25:20+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-16T09:41:49+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.42", + "version": "v3.4.43", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -3031,11 +3150,25 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-05-30T17:48:24+00:00" }, { "name": "symfony/finder", - "version": "v3.4.42", + "version": "v3.4.43", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -3080,20 +3213,34 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-02-14T07:34:21+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.17.1", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d" + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", - "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", "shasum": "" }, "require": { @@ -3105,7 +3252,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3142,25 +3289,40 @@ "polyfill", "portable" ], - "time": "2020-06-06T08:46:27+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.17.1", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "a57f8161502549a742a63c09f0a604997bf47027" + "reference": "bc6549d068d0160e0f10f7a5a23c7d1406b95ebe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a57f8161502549a742a63c09f0a604997bf47027", - "reference": "a57f8161502549a742a63c09f0a604997bf47027", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/bc6549d068d0160e0f10f7a5a23c7d1406b95ebe", + "reference": "bc6549d068d0160e0f10f7a5a23c7d1406b95ebe", "shasum": "" }, "require": { "php": ">=5.3.3", - "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-intl-normalizer": "^1.10", + "symfony/polyfill-php70": "^1.10", "symfony/polyfill-php72": "^1.10" }, "suggest": { @@ -3169,7 +3331,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3193,6 +3355,10 @@ "name": "Laurent Bassin", "email": "laurent@bassin.info" }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" @@ -3208,20 +3374,115 @@ "portable", "shim" ], - "time": "2020-06-06T08:46:27+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.18.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.17.1", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7110338d81ce1cbc3e273136e4574663627037a7" + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7110338d81ce1cbc3e273136e4574663627037a7", - "reference": "7110338d81ce1cbc3e273136e4574663627037a7", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", "shasum": "" }, "require": { @@ -3233,7 +3494,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3271,20 +3532,111 @@ "portable", "shim" ], - "time": "2020-06-06T08:46:27+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.18.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", + "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.17.0", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "f048e612a3905f34931127360bdd2def19a5e582" + "reference": "639447d008615574653fb3bc60d1986d7172eaae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", - "reference": "f048e612a3905f34931127360bdd2def19a5e582", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae", + "reference": "639447d008615574653fb3bc60d1986d7172eaae", "shasum": "" }, "require": { @@ -3293,7 +3645,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -3326,20 +3682,34 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/process", - "version": "v3.4.42", + "version": "v3.4.43", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "8a895f0c92a7c4b10db95139bcff71bdf66d4d21" + "reference": "af8d812d75fcdf2eae30928b42396fe17df137e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/8a895f0c92a7c4b10db95139bcff71bdf66d4d21", - "reference": "8a895f0c92a7c4b10db95139bcff71bdf66d4d21", + "url": "https://api.github.com/repos/symfony/process/zipball/af8d812d75fcdf2eae30928b42396fe17df137e4", + "reference": "af8d812d75fcdf2eae30928b42396fe17df137e4", "shasum": "" }, "require": { @@ -3375,11 +3745,25 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2020-05-23T17:05:51+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-16T09:41:49+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.42", + "version": "v3.4.43", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -3424,20 +3808,34 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-03-15T09:38:08+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.42", + "version": "v3.4.43", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "7233ac2bfdde24d672f5305f2b3f6b5d741ef8eb" + "reference": "e7fa05917ae931332a42d65b577ece4d497aad81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/7233ac2bfdde24d672f5305f2b3f6b5d741ef8eb", - "reference": "7233ac2bfdde24d672f5305f2b3f6b5d741ef8eb", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e7fa05917ae931332a42d65b577ece4d497aad81", + "reference": "e7fa05917ae931332a42d65b577ece4d497aad81", "shasum": "" }, "require": { @@ -3483,24 +3881,38 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2020-05-11T07:51:54+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-23T09:37:51+00:00" }, { "name": "webmozart/assert", - "version": "1.9.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "9dc4f203e36f2b486149058bade43c851dd97451" + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/9dc4f203e36f2b486149058bade43c851dd97451", - "reference": "9dc4f203e36f2b486149058bade43c851dd97451", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", + "php": "^5.3.3 || ^7.0 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -3532,7 +3944,7 @@ "check", "validate" ], - "time": "2020-06-16T10:16:42+00:00" + "time": "2020-07-08T17:02:28+00:00" }, { "name": "wp-cli/cache-command", @@ -4402,16 +4814,16 @@ }, { "name": "wp-cli/i18n-command", - "version": "v2.2.4", + "version": "v2.2.5", "source": { "type": "git", "url": "https://github.com/wp-cli/i18n-command.git", - "reference": "9784ff2c074d1765442b618e6d3a43fee2093a05" + "reference": "b02ecdc9a57f9633740c254d19749118b7411f0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/9784ff2c074d1765442b618e6d3a43fee2093a05", - "reference": "9784ff2c074d1765442b618e6d3a43fee2093a05", + "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/b02ecdc9a57f9633740c254d19749118b7411f0f", + "reference": "b02ecdc9a57f9633740c254d19749118b7411f0f", "shasum": "" }, "require": { @@ -4455,7 +4867,7 @@ ], "description": "Provides internationalization tools for WordPress projects.", "homepage": "https://github.com/wp-cli/i18n-command", - "time": "2020-06-12T00:17:09+00:00" + "time": "2020-07-08T15:20:38+00:00" }, { "name": "wp-cli/import-command", @@ -5589,6 +6001,24 @@ ], "time": "2020-04-01T14:35:27+00:00" }, + { + "name": "wpackagist-plugin/jetpack", + "version": "8.7.1", + "source": { + "type": "svn", + "url": "https://plugins.svn.wordpress.org/jetpack/", + "reference": "tags/8.7.1" + }, + "dist": { + "type": "zip", + "url": "https://downloads.wordpress.org/plugin/jetpack.8.7.1.zip" + }, + "require": { + "composer/installers": "~1.0" + }, + "type": "wordpress-plugin", + "homepage": "https://wordpress.org/plugins/jetpack/" + }, { "name": "wpsh/local", "version": "0.2.3", diff --git a/phpunit.xml b/phpunit.xml index 4b301981e..c146db80e 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,6 +7,12 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" > + + + tests diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 63002091c..07aa80d8c 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -14,6 +14,31 @@ // @see https://core.trac.wordpress.org/browser/trunk/tests/phpunit/includes/functions.php require_once $_tests_dir . '/includes/functions.php'; +/** + * Force plugins defined in a constant (supplied by phpunit.xml) to be active at runtime. + * + * @filter site_option_active_sitewide_plugins + * @filter option_active_plugins + * + * @param array $active_plugins + * @return array + */ +function xwp_filter_active_plugins_for_phpunit( $active_plugins ) { + $forced_active_plugins = array(); + if ( defined( 'WP_TEST_ACTIVATED_PLUGINS' ) ) { + $forced_active_plugins = preg_split( '/\s*,\s*/', WP_TEST_ACTIVATED_PLUGINS ); + } + + if ( ! empty( $forced_active_plugins ) ) { + foreach ( $forced_active_plugins as $forced_active_plugin ) { + $active_plugins[] = $forced_active_plugin; + } + } + return $active_plugins; +} +tests_add_filter( 'site_option_active_sitewide_plugins', 'xwp_filter_active_plugins_for_phpunit' ); +tests_add_filter( 'option_active_plugins', 'xwp_filter_active_plugins_for_phpunit' ); + tests_add_filter( 'muplugins_loaded', function() { @@ -22,6 +47,8 @@ function() { } ); +tests_add_filter( 'jetpack_offline_mode', '__return_true' ); + // @see https://core.trac.wordpress.org/browser/trunk/tests/phpunit/includes/bootstrap.php require $_tests_dir . '/includes/bootstrap.php'; diff --git a/tests/tests/connectors/test-class-connector-jetpack.php b/tests/tests/connectors/test-class-connector-jetpack.php new file mode 100644 index 000000000..61579a7cd --- /dev/null +++ b/tests/tests/connectors/test-class-connector-jetpack.php @@ -0,0 +1,184 @@ +mock = $this->getMockBuilder( Connector_Jetpack::class ) + ->setMethods( array( 'log' ) ) + ->getMock(); + + // Register connector. + $this->mock->register(); + } + + public function test_jetpack_installed_and_activated() { + $this->assertTrue( class_exists( 'Jetpack', 'Jetpack is inactive' ) ); + } + + public function test_callback_jetpack_log_entry() { + // Prepare scenario + + // Expected log calls. + $this->mock->expects( $this->once() ) + ->method( 'log' ) + ->with( + + ); + + // Do stuff. + + // Check callback test action. + $this->assertFalse( 0 === did_action( 'wp_stream_test_callback_jetpack_log_entry' ) ); + } + + public function test_callback_sharing_get_services_state() { + // Prepare scenario. + require_once JETPACK__PLUGIN_DIR. 'modules/sharedaddy/sharing-service.php'; + $sharer = new \Sharing_Service(); + + // Expected log calls. + $this->mock->expects( $this->exactly( 2 ) ) + ->method( 'log' ) + ->withConsecutive( + array( + $this->equalTo( __( '"%s" setting updated', 'stream' ) ), + $this->equalTo( + array( + 'option_title' => 'Sharing options', + 'option' => 'sharing-options', + 'old_value' => null, + 'new_value' => array( + 'global' => array( + 'button_style' => 'icon-text', + 'sharing_label' => 'Share this:', + 'open_links' => 'same', + 'show' => array( 'post', 'page' ), + 'custom' => array(), + ), + ) + ) + ), + $this->equalTo( null ), + $this->equalTo( 'sharedaddy' ), + $this->equalTo( 'updated' ) + ), + array( + $this->equalTo( __( 'Sharing services updated', 'stream' ) ), + $this->equalTo( + array( + 'services' => array( + 'print' => 'Share_Print', + 'facebook' => 'Share_Facebook', + 'linkedin' => 'Share_LinkedIn', + 'reddit' => 'Share_Reddit', + 'twitter' => 'Share_Twitter', + 'tumblr' => 'Share_Tumblr', + 'pinterest' => 'Share_Pinterest', + 'pocket' => 'Share_Pocket', + 'telegram' => 'Share_Telegram', + 'jetpack-whatsapp' => 'Jetpack_Share_WhatsApp', + 'skype' => 'Share_Skype', + ), + 'available' => array( + 'print', + 'facebook', + 'linkedin', + 'reddit', + 'twitter', + 'tumblr', + 'pinterest', + 'pocket', + 'telegram', + 'jetpack-whatsapp', + 'skype', + ), + 'hidden' => array(), + 'visible' => array(), + 'currently_enabled' => array( + 'visible' => array( + 'twitter' => new \Share_Twitter(), + 'facebook' => new \Share_Facebook(), + ), + 'hidden' => array(), + 'all' => array( 'twitter', 'facebook' ), + ), + ) + ), + $this->equalTo( null ), + $this->equalTo( 'sharedaddy' ), + $this->equalTo( 'updated' ) + ) + ); + + // Do stuff. + $sharer->set_blog_services( + array( 'facebook' => 'Share_Facebook' ), + array( 'reddit' => 'Share_Reddit' ) + ); + + // Check callback test action. + $this->assertFalse( 0 === did_action( 'wp_stream_test_callback_sharing_get_services_state' ) ); + } + + public function test_callback_jetpack_module_configuration_load_monitor() { + // Prepare scenario + + // Expected log calls. + $this->mock->expects( $this->once() ) + ->method( 'log' ) + ->with( + + ); + + // Do stuff. + + // Check callback test action. + $this->assertFalse( 0 === did_action( 'wp_stream_test_callback_jetpack_module_configuration_load_monitor' ) ); + } + + public function test_check_function() { + // Prepare scenario + + // Expected log calls. + $this->mock->expects( $this->once() ) + ->method( 'log' ) + ->with( + + ); + + // Do stuff. + + // Check callback test action. + $this->assertFalse( 0 === did_action( 'wp_stream_test_callback_add_option' ) ); + $this->assertFalse( 0 === did_action( 'wp_stream_test_callback_update_option' ) ); + } + + public function test_track_post_by_email_function() { + // Prepare scenario + + // Expected log calls. + $this->mock->expects( $this->once() ) + ->method( 'log' ) + ->with( + + ); + + // Do stuff. + + // Check callback test action. + $this->assertFalse( 0 === did_action( 'wp_stream_test_callback_wp_ajax_jetpack_post_by_email_enable' ) ); + $this->assertFalse( 0 === did_action( 'wp_stream_test_callback_wp_ajax_jetpack_post_by_email_regenerate' ) ); + $this->assertFalse( 0 === did_action( 'wp_stream_test_callback_wp_ajax_jetpack_post_by_email_disable' ) ); + } +}