PHPackages                             gwa/wp-bridge - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. gwa/wp-bridge

ActiveLibrary[Testing &amp; Quality](/categories/testing)

gwa/wp-bridge
=============

WpBridge is a simple bridge to mock all wordpress function.

v2.1.2(10y ago)020.3k25MITPHPPHP &gt;=5.4.0

Since Jul 24Pushed 10y ago2 watchersCompare

[ Source](https://github.com/gwa/WpBridge)[ Packagist](https://packagist.org/packages/gwa/wp-bridge)[ Docs](https://github.com/gwa/WpBridge)[ RSS](/packages/gwa-wp-bridge/feed)WikiDiscussions 2.0 Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (19)Used By (5)

WpBridge
========

[](#wpbridge)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ca4f76b7fa4ae30ee3e3ef7ead914e92bf82e0d5fd7d412710fa9bc8d6839546/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6777612f77702d6272696467652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gwa/wp-bridge)[![Total Downloads](https://camo.githubusercontent.com/8936c36fcbd39670207d3c8082146cc7e24cf622e65adf28e38e99505a7cb584/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6777612f77702d6272696467652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gwa/wp-bridge)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Master
------

[](#master)

[![Build Status](https://camo.githubusercontent.com/3c5476a3e503d8df2804a2818fefffca91ce5e5b87cee3ca7c19dfa7d51fe46b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6777612f57704272696467652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/gwa/WpBridge)[![Coverage Status](https://camo.githubusercontent.com/536c405d1d92ab917a814c252f74e61f199988adf5161091386e4b02f51fba0d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6777612f57704272696467652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/gwa/WpBridge/code-structure)[![Quality Score](https://camo.githubusercontent.com/d11973fd2288595136a356330bf5bfe2fc52316d929720e5aa304c16dcb51768/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6777612f57704272696467652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/gwa/WpBridge)

Install
-------

[](#install)

Via Composer

```
$ composer require gwa/wp-bridge
```

Usage
-----

[](#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
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Great White Ark](https://github.com/gwa)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Recently: every ~22 days

Total

18

Last Release

3667d ago

Major Versions

v1.2.1 → v2.0.02016-01-06

1.1.x-dev → v2.0.12016-01-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff4c484be9fc46201a1c3c13fc961525d699d1c4e7dda68df7c5b408f147228a?d=identicon)[gwa](/maintainers/gwa)

---

Top Contributors

[![prisis](https://avatars.githubusercontent.com/u/2716058?v=4)](https://github.com/prisis "prisis (28 commits)")

---

Tags

wordpressmockerymockBridge

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gwa-wp-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/gwa-wp-bridge/health.svg)](https://phpackages.com/packages/gwa-wp-bridge)
```

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.5k](/packages/mockery-mockery)[brain/monkey

Mocking utility for PHP functions and WordPress plugin API

33412.5M350](/packages/brain-monkey)[polishsymfonycommunity/symfony-mocker-container

Provides base Symfony dependency injection container enabling service mocking.

1468.0M237](/packages/polishsymfonycommunity-symfony-mocker-container)[php-mock/php-mock-mockery

Mock built-in PHP functions (e.g. time()) with Mockery. This package relies on PHP's namespace fallback policy. No further extension is needed.

392.1M96](/packages/php-mock-php-mock-mockery)[polishsymfonycommunity/symfony2-mocker-extension

Behat extension for mocking services defined in the Symfony2 dependency injection container.

26253.1k4](/packages/polishsymfonycommunity-symfony2-mocker-extension)[lastzero/test-tools

Increases testing productivity by adding a service container and self-initializing fakes to PHPUnit

2244.3k13](/packages/lastzero-test-tools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
