diff --git a/codeception.dist.yml b/codeception.dist.yml new file mode 100644 index 0000000000000000000000000000000000000000..7e75cf592952bce2b87c2ef18bcf1e87603f24bf --- /dev/null +++ b/codeception.dist.yml @@ -0,0 +1,31 @@ +paths: + tests: tests/codeception/tests + output: tests/codeception/tests/_output + data: tests/codeception/tests/_data + support: tests/codeception/tests/_support + envs: tests/codeception/tests/_envs +actor_suffix: Tester +extensions: + enabled: + - Codeception\Extension\RunFailed +# - Codeception\Extension\Recorder: +# module: WPWebDriver +# delete_successful: false # keep screenshots of successful tests + commands: + - Codeception\Command\GenerateWPUnit + - Codeception\Command\GenerateWPRestApi + - Codeception\Command\GenerateWPRestController + - Codeception\Command\GenerateWPRestPostTypeController + - Codeception\Command\GenerateWPAjax + - Codeception\Command\GenerateWPCanonical + - Codeception\Command\GenerateWPXMLRPC + - WPDesk\Codeception\Command\GeneratePluginActivation + - WPDesk\Codeception\Command\GenerateWooCommerce + - tad\Codeception\Command\Steppify +params: + - .env.testing +coverage: + remote: false + include: + - classes + - src diff --git a/composer.json b/composer.json index 955dd0181ac1dd5df007167f31a070b6c9e157c1..f78d53db085893a2aac1e310c65fef4342eca161 100644 --- a/composer.json +++ b/composer.json @@ -13,20 +13,25 @@ ], "config": { "platform": { - "php": "7.0" + "php": "7.0.8" + }, + "allow-plugins": { + "kylekatarnls/update-helper": true, + "wpdesk/wp-codeception": true } }, "require": { - "php": ">=7.0", + "php": ">=7.0.8", "wpdesk/wp-builder": "^1.0|^2.0" }, "require-dev": { - "phpunit/phpunit": "<7", + "phpunit/phpunit": "*", "wp-coding-standards/wpcs": "^0.14.1", "squizlabs/php_codesniffer": "^3.0.2", "mockery/mockery": "*", "10up/wp_mock": "*", - "wimg/php-compatibility": "^8" + "wimg/php-compatibility": "^8", + "wpdesk/wp-codeception": "^2.7" }, "autoload": { "psr-4": {"WPDesk\\Notice\\": "src/WPDesk/Notice/"}, diff --git a/tests/codeception/codeception.yml b/tests/codeception/codeception.yml new file mode 100644 index 0000000000000000000000000000000000000000..18bdc7c088d3bd98e142b834722fa4dc9b6566b9 --- /dev/null +++ b/tests/codeception/codeception.yml @@ -0,0 +1,11 @@ +paths: + tests: tests + output: tests/_output + data: tests/_data + support: tests/_support + envs: tests/_envs +actor_suffix: Tester +extensions: + enabled: + - Codeception\Extension\RunFailed + diff --git a/tests/codeception/tests/_data/.gitkeep b/tests/codeception/tests/_data/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/codeception/tests/_output/.gitignore b/tests/codeception/tests/_output/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d6b7ef32c8478a48c3994dcadc86837f4371184d --- /dev/null +++ b/tests/codeception/tests/_output/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/codeception/tests/functional/.gitkeep b/tests/codeception/tests/functional/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/codeception/tests/integration.suite.yml b/tests/codeception/tests/integration.suite.yml new file mode 100644 index 0000000000000000000000000000000000000000..3d7e2215ace61eaee718c596d1c3c9e99b168b3e --- /dev/null +++ b/tests/codeception/tests/integration.suite.yml @@ -0,0 +1,30 @@ +# Codeception Test Suite Configuration +# +# Suite for integration tests. + +modules: + enabled: + - WPDb + - WPLoader + config: + WPDb: + dsn: 'mysql:host=%TEST_SITE_DB_HOST%;dbname=%TEST_SITE_DB_NAME%' + user: '%TEST_SITE_DB_USER%' + password: '%TEST_SITE_DB_PASSWORD%' + waitlock: 10 + url: '%TEST_SITE_WP_URL%' + originalUrl: '%TEST_SITE_WP_URL%' + urlReplacement: true #replace the hardcoded dump URL with the one above + tablePrefix: '%TEST_SITE_TABLE_PREFIX%' + WPLoader: + multisite: false + wpRootFolder: '%WP_ROOT_FOLDER%' + dbName: "%TEST_SITE_DB_NAME%" + dbHost: "%TEST_SITE_DB_HOST%" + dbUser: "%TEST_SITE_DB_USER%" + dbPassword: "%TEST_SITE_DB_PASSWORD%" + isolatedInstall: true + loadOnly: true + tablePrefix: "%TEST_SITE_TABLE_PREFIX%" + plugins: [] + activatePlugins: [] diff --git a/tests/codeception/tests/unit/.gitkeep b/tests/codeception/tests/unit/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/codeception/wpdesk.yml b/tests/codeception/wpdesk.yml new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391