PHPackages                             dazz/oauth2-server-httpfoundation-webtest - 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. dazz/oauth2-server-httpfoundation-webtest

AbandonedLibrary

dazz/oauth2-server-httpfoundation-webtest
=========================================

A bridge for webtesting oauth2-server-php with bshaffer/oauth2-server-httpfoundation-bridge and silex

14.3k2[1 PRs](https://github.com/dazz/oauth2-server-httpfoundation-webtest/pulls)PHPCI failing

Since May 6Pushed 13y agoCompare

[ Source](https://github.com/dazz/oauth2-server-httpfoundation-webtest)[ Packagist](https://packagist.org/packages/dazz/oauth2-server-httpfoundation-webtest)[ RSS](/packages/dazz-oauth2-server-httpfoundation-webtest/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

oauth2-server-httpfoundation-webtest
====================================

[](#oauth2-server-httpfoundation-webtest)

A webtesting bridge for oauth2-server-php with [bshaffer/oauth2-server-httpfoundation-bridge](https://github.com/bshaffer/oauth2-server-httpfoundation-bridge).

Silex, Symfony and other frameworks depending on symfony/http-kernel offer a WebTestCase class for testing controller/actions. In order to write webtests for actions that are secured by the bshaffer/oauth2-server-php the request instance needs to implement \\OAuth2\_RequestInterface.

To achieve a valid request object the WebTestCase classes need to extend the WebTestCase class provided here.

Install
-------

[](#install)

add to `composer.json`

```
{
  "minimum-stability": "dev",
  "require-dev": {
    "dazz/oauth2-server-httpfoundation-webtest":"dev-master"
  }
}
```

Run `composer.phar update --dev` to install the development dependencies.

Example for Silex
-----------------

[](#example-for-silex)

```
namespace Company\Test\SomeBundle\Controller

use OAuth2\HttpFoundationWebTest\Silex\WebTestCase;

class UserControllerTest extends WebTestCase
{
    public function testGetUser()
    {
        // create user, oauth2-client and access_token in the test-storage
        $accessToken = 'abc';
        // this creates the browsing client, not to mix up with the oauth2-client
        $client = $this->createClient();

        $client->request('GET', '/user/', array('access_token' => $accessToken));

        $this->assertTrue($client->getResponse()->isSuccessful());
    }

    public function testProjects()
    {
        $accessToken = 'abc';
        $client = $this->createClient();

        $content = json_encode(array(
            'name' => 'My Project',
        ));

        // the content of $server['HTTP_AUTHORIZATION'] will be copied to the header
        $server = array(
            'HTTP_AUTHORIZATION'=> sprintf('Bearer %s', $accessToken),
        );

        $client->request('PUT', '/projects/theId', array(), array(), $server, $content);

        // all sorts of assertions on response string
        $this->assertTrue($client->getResponse()->isSuccessful());
    }
}
```

Links
-----

[](#links)

- [oauth2-server-httpfoundation-bridge](https://github.com/bshaffer/oauth2-server-httpfoundation-bridge)
- [oauth2-server-php](https://github.com/bshaffer/oauth2-server-php)
- [Silex](http://silex.sensiolabs.org/doc/testing.html)
- [Symfony](http://symfony.com/doc/current/book/testing.html#your-first-functional-test)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% 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.

### Community

Maintainers

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

---

Top Contributors

[![dazz](https://avatars.githubusercontent.com/u/182954?v=4)](https://github.com/dazz "dazz (9 commits)")[![till](https://avatars.githubusercontent.com/u/27003?v=4)](https://github.com/till "till (1 commits)")

### Embed Badge

![Health badge](/badges/dazz-oauth2-server-httpfoundation-webtest/health.svg)

```
[![Health](https://phpackages.com/badges/dazz-oauth2-server-httpfoundation-webtest/health.svg)](https://phpackages.com/packages/dazz-oauth2-server-httpfoundation-webtest)
```

PHPackages © 2026

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