diff --git a/apigen.neon b/apigen.neon new file mode 100644 index 0000000000000000000000000000000000000000..800455918ae525bff0f5683dd73a3d7d01fbe855 --- /dev/null +++ b/apigen.neon @@ -0,0 +1,27 @@ +destination: docs +templateConfig: /app/theme-woocommerce/config.neon +extensions: [php] +source: + - src +exclude: + - vendor + - tests + - languages + +charset: [UTF-8] +main: Wordpress plugin +title: Plugin template more info +baseUrl: "/" + +templateTheme: default +php: false +sourceCode: false +tree: true +deprecated: false +todo: false +download: false + +accessLevels: + - public + - private + - protected \ No newline at end of file diff --git a/composer.json b/composer.json index 95f8e78db5678ea5d222a31e7efbeb708c73eb78..0f7b8c9029c31b5f3ec89d7a21373b8e113a2730 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,10 @@ "scripts": { "phpcs": "phpcs", "phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never", - "phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage" + "phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage", + "phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never", + "phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage", + + "docs": "apigen generate" } } diff --git a/phpunit-integration.xml b/phpunit-integration.xml new file mode 100644 index 0000000000000000000000000000000000000000..fe31963657aea8edd36027ef763699d54b7fa941 --- /dev/null +++ b/phpunit-integration.xml @@ -0,0 +1,27 @@ +<phpunit bootstrap="tests/integration/bootstrap.php" + backupGlobals="false" + > + <testsuites> + <testsuite> + <directory prefix="test-" suffix=".php">./tests/integration</directory> + </testsuite> + </testsuites> + + <filter> + <whitelist> + <directory suffix=".php">classes</directory> + </whitelist> + </filter> + + <logging> + <log type="junit" target="build-coverage/report.junit.xml"/> + <log type="coverage-html" target="build-coverage/coverage" charset="UTF-8" yui="true" highlight="true"/> + <log type="coverage-text" target="build-coverage/coverage.txt"/> + <log type="coverage-clover" target="build-coverage/clover.xml"/> + </logging> + <php> + <env name="WP_DEVELOP_DIR" value="/tmp/wordpress-develop"/> + <env name="WC_DEVELOP_DIR" value="/tmp/woocommerce"/> + </php> + +</phpunit> \ No newline at end of file diff --git a/tests/integration/bootstrap.php b/tests/integration/bootstrap.php new file mode 100644 index 0000000000000000000000000000000000000000..13777fc2877021cb73be3f19c0d057a69e5066a6 --- /dev/null +++ b/tests/integration/bootstrap.php @@ -0,0 +1,16 @@ +<?php +// disable xdebug backtrace +if ( function_exists( 'xdebug_disable' ) ) { + xdebug_disable(); +} + +if ( getenv( 'PLUGIN_PATH' ) !== false ) { + define( 'PLUGIN_PATH', getenv( 'PLUGIN_PATH' ) ); +} else { + define( 'PLUGIN_PATH', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR ); +} + +require_once( getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit/includes/functions.php' ); + +putenv('WP_TESTS_DIR=' . getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit'); +require_once( getenv( 'WC_DEVELOP_DIR' ) . '/tests/bootstrap.php' );