定制 gwa/mockery-wp-bridge 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gwa/mockery-wp-bridge

最新稳定版本:v2.1.2

Composer 安装命令:

composer require gwa/mockery-wp-bridge

包简介

WpBridge is a simple bridge to mock all wordpress function.

README 文档

README

Latest Version on Packagist Total Downloads Software License

Master

Build Status Coverage Status Quality Score

Install

Via Composer

$ composer require gwa/wp-bridge

Usage

First init WpBridge class.

$bridge = new \Gwa\Wordpress\WpBridge\WpBridge();

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\WpBridge\Traits\WpBridgeTrait;

class TestClass
{
    use WpBridgeTrait;

    public function testFunc()
    {
        $img = $this->getWpBridge()->wpGetAttachmentImageSrc(...);

        ...
    }
}

$test = new TestClass();
$test->setWpBridge($bridge);

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 1.34k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-24