diff --git a/README.md b/README.md index 995cb5d..d23499e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# rask/wp-test-framework +# msaari/wp-test-framework Extracted and librarized version of WordPress core's PHPUnit test framework to help with writing integration tests in WordPress plugins and themes. @@ -10,7 +10,7 @@ The sources are updated when needed, so there may be minor differences between t This library should be installed as a Composer dependency inside your plugin or theme: - $ composer require --dev rask/wp-test-framework + $ composer require --dev msaari/wp-test-framework ### WordPress testing installation setup @@ -34,7 +34,7 @@ Inside your plugin/theme directory you need to setup PHPUnit. Any regular-ish `p require_once './vendor/autoload.php'; - \rask\WpTestFramework\Framework::load(); + \msaari\WpTestFramework\Framework::load(); Then you should load your plugin or theme. In the same bootstrap file you can do the following: @@ -42,7 +42,7 @@ Then you should load your plugin or theme. In the same bootstrap file you can do require_once './vendor/autoload.php'; - \rask\WpTestFramework\Framework::load(); + \msaari\WpTestFramework\Framework::load(); // Load your plugin diff --git a/composer.json b/composer.json index 11cb181..0570864 100644 --- a/composer.json +++ b/composer.json @@ -1,16 +1,16 @@ { - "name": "rask/wp-test-framework", + "name": "msaari/wp-test-framework", "description": "Extracted library from WordPress PHPUnit framework to aid in integration testing of plugins and themes", "type": "library", "keywords": ["wordpress", "testing", "tests", "phpunit"], "license": "GPL-3.0-or-later", "support": { - "source": "https://github.com/rask/wp-test-framework" + "source": "https://github.com/msaari/wp-test-framework" }, "autoload": { "psr-4": { - "rask\\WpTestFramework\\": "src/" + "msaari\\WpTestFramework\\": "src/" } }, diff --git a/src/phpunit/includes/mock-mailer.php b/src/phpunit/includes/mock-mailer.php index ece2aa3..319b6ab 100644 --- a/src/phpunit/includes/mock-mailer.php +++ b/src/phpunit/includes/mock-mailer.php @@ -1,7 +1,16 @@ =' ) ) { + require_once ABSPATH . '/wp-includes/PHPMailer/PHPMailer.php'; + class MailerClass extends PHPMailer\PHPMailer\PHPMailer {} +} else { + require_once ABSPATH . '/wp-includes/class-phpmailer.php'; + class MailerClass extends PHPMailer {} +} + +class MockPHPMailer extends MailerClass { -class MockPHPMailer extends PHPMailer { var $mock_sent = array(); function preSend() {