Via Composer
$ composer require gwa/mockery-wp-bridge
First init MockeryWpBridge
class.
$bridge = new \Gwa\Wordpress\MockeryWpBridge\MockeryWpBridge();
Now it allows us to use a class to call methods in the global namespace. Methods should be called in camelcase.
// To call
wp_get_attachment_image_src(...);
// use
$bridge->wpGetAttachmentImageSrc(...);
Or you like to use a trait, than set WpBridgeTrait
in a class.
use Gwa\Wordpress\MockeryWpBridge\Traits\WpBridgeTrait;
class TestClass
{
use WpBridgeTrait;
public function testFunc()
{
$img = $this->getWpBridge()->wpGetAttachmentImageSrc(...);
...
}
}
$test = new TestClass();
$test->setWpBridge($bridge);
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.