<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stephenharris / phpunit-require-wordpress-version example snippets
class My_Test_Case extends WP_UnitTestCase {
use StephenHarris\PHPUnit\RequiresWordPressVersion;
}
class My_Test extends My_Test_Case {
/**
* @ta() {
// test will be skipped unless WordPress >= 4.4.0
}
}-
class My_Test_Case extends WP_UnitTestCase {
use StephenHarris\PHPUnit\RequiresWordPressVersion;
}
class My_Test_Case extends WP_UnitTestCase {
use StephenHarris\PHPUnit\RequiresWordPressVersion {
checkRequirements as checkWordPressVersionRequirements;
}
function checkRequirements() {
$this->checkWordPressVersionRequirements();
//... your checkRequirements() method here
}
}
class My_Test_Case extends WP_UnitTestCase {
use StephenHarris\PHPUnit\RequiresWordPressVersion {
checkRequirements as checkWordPressVersionRequirements;
}
use Some\Other\checkRequirementsTrait {
checkRequirements as checkSomeOtherRequirements;
}
function checkRequirements() {
$this->checkWordPressVersionRequirements();
$this->checkSomeOtherRequirements();
}
}
class My_Test extends My_Test_Case {
/**
* @() {
// test will be skipped unless WordPress >= 4.4.0
}
/**
* @23
// also works if you specify 4.4-alpha-123 instead
}
/**
* @
*/
function testOnlyRunsForWordPress460() {
// test will only run with version 4.6.0
}
/**
* @s WordPress <= 4.2.0
*/
function testOnlyRunsFor420AndEarlier() {
// test will only run for WordPress version 4.2.0 and earlier
}
}
/**
* @
/**
* @
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.