{"id":15525561,"url":"https://github.com/jakzal/behatnoextension","last_synced_at":"2025-04-16T05:48:42.993Z","repository":{"id":26809191,"uuid":"30267704","full_name":"jakzal/BehatNoExtension","owner":"jakzal","description":"This Behat extension makes it possible to extend Behat without having to write an extension yourself.","archived":false,"fork":false,"pushed_at":"2019-12-15T09:21:25.000Z","size":64,"stargazers_count":31,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T17:40:25.452Z","etag":null,"topics":["behat","behat-extension","container","php","psr-11","symfony"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/zalas/behat-no-extension","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakzal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-03T22:20:25.000Z","updated_at":"2024-09-02T10:41:08.000Z","dependencies_parsed_at":"2022-08-20T16:00:28.533Z","dependency_job_id":null,"html_url":"https://github.com/jakzal/BehatNoExtension","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakzal%2FBehatNoExtension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakzal%2FBehatNoExtension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakzal%2FBehatNoExtension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakzal%2FBehatNoExtension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakzal","download_url":"https://codeload.github.com/jakzal/BehatNoExtension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249204660,"owners_count":21229779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["behat","behat-extension","container","php","psr-11","symfony"],"created_at":"2024-10-02T10:58:37.286Z","updated_at":"2025-04-16T05:48:42.972Z","avatar_url":"https://github.com/jakzal.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Behat No Extension\n==================\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jakzal/BehatNoExtension/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/jakzal/BehatNoExtension/?branch=master)\n[![Build Status](https://scrutinizer-ci.com/g/jakzal/BehatNoExtension/badges/build.png?b=master)](https://scrutinizer-ci.com/g/jakzal/BehatNoExtension/build-status/master)\n[![Build Status](https://travis-ci.org/jakzal/BehatNoExtension.svg?branch=master)](https://travis-ci.org/jakzal/BehatNoExtension)\n\nThis Behat extension makes it possible to extend Behat without having to write an\nextension yourself.\n\n\nInstallation\n------------\n\nThis extension requires:\n\n* Behat ^3.0\n* PHP ^7.1\n\nThe easiest way to install it is to use Composer\n\n```\n$ composer require --dev zalas/behat-no-extension\n```\n\nNext, activate the extension in your ``behat.yml``:\n\n```yaml\n# behat.yml\ndefault:\n  extensions:\n    Zalas\\Behat\\NoExtension: ~\n```\n\nImporting service definitions\n-----------------------------\n\nExtension enables you to load service definitions and parameters from\nconfiguration files specified in the ``imports`` section:\n\n```yaml\n# behat.yml\ndefault:\n  extensions:\n    Zalas\\Behat\\NoExtension:\n      imports:\n        - features/bootstrap/config/services.yml\n```\n\nThese should simply be\n[Symfony's service container](http://symfony.com/doc/current/components/dependency_injection/introduction.html#setting-up-the-container-with-configuration-files)\nconfiguration files:\n\n```yaml\n# features/bootstrap/config/services.yml\nservices:\n  Acme\\SimpleArgumentResolver:\n    tags:\n      - { name: context.argument_resolver }\n\nparameters:\n  acme.foo: boo!\n```\n\nYaml, xml and php formats are currently supported.\n\nNote that any classes you'd like to use should be autoloaded by composer.\nFor the example above, `autoload-dev` or `autoload` should include the `Acme\\\\` autoloader prefix.\n\nInjecting services into contexts\n--------------------------------\n\nEnable the argument resolver to take advantage of the built in support for service injection:\n\n```yaml\n# behat.yml\ndefault:\n  extensions:\n    Zalas\\Behat\\NoExtension:\n      argument_resolver: true\n      imports:\n        - features/bootstrap/config/services.yml\n```\n\nAssuming services you'd like to inject into contexts are defined in `features/bootstrap/Acme`,\nand they're autoloaded by composer, you can now start defining them in your configuration file:\n\n```yaml\n# features/bootstrap/config/services.yml\nservices:\n\n    Acme\\:\n        resource: '../Acme'\n        public: true\n        autowire: true\n```\n\nThe above example relies on autoworing, but you could also define each service explicitly.\n\nAn example composer autoloader configuration:\n\n```json\n{\n    \"autoload-dev\": {\n        \"psr-4\": {\n            \"Acme\\\\\": \"features/bootstrap/Acme\"\n        }\n    }\n}\n```\n\nGiven there's a class `Acme\\Foo` defined, it can now be injected into contexts:\n\n```php\nuse Acme\\Foo;\nuse Behat\\Behat\\Context\\Context;\n\nclass FeatureContext implements Context\n{\n    private $foo;\n\n    public function __construct(Foo $foo)\n    {\n        $this-\u003efoo = $foo;\n    }\n}\n```\n\nDefining parameters\n-------------------\n\nParameters defined in imported files are also available in ``behat.yml``:\n\n```yaml\n# behat.yml\ndefault:\n  suites:\n    search:\n      contexts:\n        - SearchContext:\n            myFoo: '%acme.foo%'\n  # ...\n```\n\nFurthermore, parameters can also be defined as part of extension's configuration directly in ``behat.yml``:\n\n```yaml\n# behat.yml\ndefault:\n  extensions:\n    Zalas\\Behat\\NoExtension:\n      parameters:\n        foo: bar\n        baz:\n          a: 1\n          b: 'bazinga!'\n```\n\n## Contributing\n\nPlease read the [Contributing guide](CONTRIBUTING.md) to learn about contributing to this project.\nPlease note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).\nBy participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakzal%2Fbehatnoextension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakzal%2Fbehatnoextension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakzal%2Fbehatnoextension/lists"}