PHPackages                             alteris/behat-zendframework-extension - 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. alteris/behat-zendframework-extension

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

alteris/behat-zendframework-extension
=====================================

Extension connect Behat scenario with Zendframework application

v1.0.0(9y ago)422.0k21MITPHP

Since Sep 27Pushed 9y ago3 watchersCompare

[ Source](https://github.com/alteris/behat-zendframework-extension)[ Packagist](https://packagist.org/packages/alteris/behat-zendframework-extension)[ RSS](/packages/alteris-behat-zendframework-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (1)

Behat Zend framework integration
================================

[](#behat-zend-framework-integration)

Integration [Behat](http://behat.org/en/latest/) ^3.1 with `Zend\Mvc\ApplicationInterface`. This should allow integrate with Zend framework v2.\* and v3.\*.

Installing extension
--------------------

[](#installing-extension)

The easiest way to install is by using [Composer](https://getcomposer.org):

```
$> curl -sS https://getcomposer.org/installer | php
$> php composer.phar require alteris/behat-zendframework-extension='~1.0'
```

or composer.json

```
"require": {
    "alteris/behat-zendframework-extension": "~1.0"
},

```

Configuration
-------------

[](#configuration)

You can then activate the extension in your `behat.yml`:

```
    default:
        # ...
        extensions:
            Alteris\BehatZendframeworkExtension\ServiceContainer\Extension:
                configuration: PATH_TO_application.config.php

```

Injecting Application
---------------------

[](#injecting-application)

Your context need to implement `Alteris\BehatZendframeworkExtension\Context\ContextAwareInterface` and will be intialized with `Zend\Mcv\ApplicationInterface`;

Injecting Services
------------------

[](#injecting-services)

The extension will automatically convert parameters injected into a context. You need to have set alias/name starting with '@':

```
default:
    suites:
        default:
            contexts:
                - FeatureContext:
                    testService: '@testService'
        extensions:
            Alteris\BehatZendframeworkExtension\ServiceContainer\Extension:
                configuration: PATH_TO_application.config.php

```

The FeatureContext will then be initialized with the service from the Zend Framework container:

```
