PHPackages                             misd/mock-raven-service-bundle - 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. misd/mock-raven-service-bundle

ActiveSymfony-bundle[Testing &amp; Quality](/categories/testing)

misd/mock-raven-service-bundle
==============================

Provides a controller replicating the Raven service, allow applications to functionally test the logging in process

0117PHP

Since Jun 17Pushed 12y ago2 watchersCompare

[ Source](https://github.com/misd-service-development/mock-raven-service-bundle)[ Packagist](https://packagist.org/packages/misd/mock-raven-service-bundle)[ RSS](/packages/misd-mock-raven-service-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MisdMockRavenServiceBundle
==========================

[](#misdmockravenservicebundle)

[![Build Status](https://camo.githubusercontent.com/7f87fe8642ea84c7a76cd7b45e17ac84f36b3ac024d0bc10da19582f381b945c/68747470733a2f2f7472617669732d63692e6f72672f6d6973642d736572766963652d646576656c6f706d656e742f6d6f636b2d726176656e2d736572766963652d62756e646c652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/misd-service-development/mock-raven-service-bundle)

Provides a controller replicating the Raven service, allow applications to functionally test the logging in process.

Authors
-------

[](#authors)

- Chris Wilkinson

Requirements
------------

[](#requirements)

- [Symfony 2](http://symfony.com/)
- [PHP OpenSSL library](http://www.php.net/manual/en/book.openssl.php)

Installation
------------

[](#installation)

1. Add the bundle to your dev dependencies:

    ```
    // composer.json

    {
       // ...
       "require-dev": {
           // ...
           "misd/mock-raven-service-bundle": "~1.0@dev"
       }
    }

    ```
2. Use Composer to download and install the bundle:

    ```
    $ php composer.phar update misd/mock-raven-service-bundle

    ```
3. Register the bundle in your application's test environment:

    ```
    // app/AppKernel.php

    class AppKernel extends Kernel
    {
        // ...
        public function registerBundles()
        {
            // ...
            if ('test' === $this->getEnvironment()) {
                $bundles[] = new Misd\MockRavenServiceBundle\MisdMockRavenServiceBundle();
            }
            // ...
        }
        // ...
    }

    ```
4. Add the bundle's routes to your test routing config:

    ```
    // app/routing_test.yml

    misd_mock_raven_service:
        resource: "@MisdMockRavenServiceBundle/Resources/config/routing.yml"

    ```
5. Make sure that the mock Raven service path is unsecured:

    ```
    // app/security.yml

    mock_raven_service:
        pattern: ^/auth/authenticate.html
        security: false

    ```

If you are using the [misd/raven-bundle](https://github.com/misd-service-development/raven-bundle) make sure that your test environment is using the Raven test service:

```
// app/config_test.yml

misd_raven:
    use_test_service: true

```

Usage
-----

[](#usage)

The bundle, by default, will see a user logged in to Raven with the CRSid 'test0001'.

For example, in a test case extending `Symfony\Bundle\FrameworkBundle\Test\WebTestCase` running:

```
$client = static::createClient();
$client->followRedirects();
$client->request('GET', '/secured-page');

```

will see a successful Raven login response returned. If you are using the [misd/raven-bundle](https://github.com/misd-service-development/raven-bundle) the Raven response will have been processed for you.

### Customising the Raven service response

[](#customising-the-raven-service-response)

Set the `next_wls_response` session attribute with an instance of `Misd\MockRavenServiceBundle\WlsResponse\WlsResponseInterface` before making a request allows you to control what response the mock Raven service returns. For example:

```
use Misd\MockRavenServiceBundle\WlsResponse\AuthenticationCancelledWlsResponse;

$client = static::createClient();
$client->followRedirects();
$client->getContainer()->get('session')->set('next_wls_response', new AuthenticationCancelledWlsResponse());
$client->request('GET', '/secured_path');

```

Available implementations are:

`Misd\MockRavenServiceBundle\WlsResponse\AuthenticationCancelled`: A '410 The user cancelled the authentication request' response.

`Misd\MockRavenServiceBundle\WlsResponse\AuthenticationDeclined`: A '570 Authentication declined' response.

`Misd\MockRavenServiceBundle\WlsResponse\GeneralRequestParameterError`: A '530 General request parameter error' response.

`Misd\MockRavenServiceBundle\WlsResponse\InteractionWouldBeRequired`: A '540 Interaction would be required' response.

`Misd\MockRavenServiceBundle\WlsResponse\NoMutuallyAcceptableAuthenticationTypesAvailable`: A '510 No mutually acceptable authentication types available' response.

`Misd\MockRavenServiceBundle\WlsResponse\SuccessfulAuthentication`: A '200 Successful authentication' response.

`Misd\MockRavenServiceBundle\WlsResponse\UnsupportedProtocolVersion`: A '520 Unsupported protocol version' response.

`Misd\MockRavenServiceBundle\WlsResponse\WaaNotAuthorised`: A '560 WAA not authorised' response.

There are also implementations that indicate broken responses:

`Misd\MockRavenServiceBundle\WlsResponse\Invalid\Expired`: A response with an expired issue date

`Misd\MockRavenServiceBundle\WlsResponse\Invalid\Incomplete`: An incomplete response.

`Misd\MockRavenServiceBundle\WlsResponse\Invalid\Invalid`: An invalid response.

`Misd\MockRavenServiceBundle\WlsResponse\Invalid\UndefinedStatusCode`: A response with an invalid status code.

`Misd\MockRavenServiceBundle\WlsResponse\Invalid\WrongAuth`: A response with an invalid 'auth' parameter.

`Misd\MockRavenServiceBundle\WlsResponse\Invalid\WrongKid`: A response with an invalid 'kid' parameter.

`Misd\MockRavenServiceBundle\WlsResponse\Invalid\WrongSso`: A response with an invalid 'sso' parameter.

`Misd\MockRavenServiceBundle\WlsResponse\Invalid\WrongUrl`: A response with a different URL.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e6aaeba393e9038b5a5a916e5f4e32ffb349436e3be2027be4828f486bc8c9d?d=identicon)[thewilkybarkid](/maintainers/thewilkybarkid)

---

Top Contributors

[![thewilkybarkid](https://avatars.githubusercontent.com/u/1784740?v=4)](https://github.com/thewilkybarkid "thewilkybarkid (25 commits)")

### Embed Badge

![Health badge](/badges/misd-mock-raven-service-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/misd-mock-raven-service-bundle/health.svg)](https://phpackages.com/packages/misd-mock-raven-service-bundle)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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