PHP code example of dingo-d / wp-pest-integration-test-setup
1. Go to this page and download the library: Download dingo-d/wp-pest-integration-test-setup library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dingo-d / wp-pest-integration-test-setup example snippets
function isUnitTest() {
return !empty($GLOBALS['argv']) && $GLOBALS['argv'][1] === '--group=unit';
}
use Yoast\WPTestUtils\WPIntegration\TestCase;
if (isUnitTest()) {
return;
}
uses(TestCase::class);
// Rest of the tests.
WPIntegration\bootstrap_it();
use Yoast\WPTestUtils\WPIntegration;
uses(TestCase::class)->in('Unit', 'Integration');
use Yoast\WPTestUtils\WPIntegration\TestCase;
uses(TestCase::class);