{"id":16568686,"url":"https://github.com/drupol/phingbehattask","last_synced_at":"2025-06-19T17:34:18.299Z","repository":{"id":65938600,"uuid":"602526129","full_name":"drupol/phingbehattask","owner":"drupol","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-17T07:50:02.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-16T00:42:07.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drupol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-16T11:57:30.000Z","updated_at":"2023-02-16T11:58:24.000Z","dependencies_parsed_at":"2023-02-22T14:30:23.473Z","dependency_job_id":null,"html_url":"https://github.com/drupol/phingbehattask","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"2ca04cd86e19b2a3444c77a864aeafb449c8ade9"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fphingbehattask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fphingbehattask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fphingbehattask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drupol%2Fphingbehattask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drupol","download_url":"https://codeload.github.com/drupol/phingbehattask/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242022904,"owners_count":20059295,"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":[],"created_at":"2024-10-11T21:11:22.461Z","updated_at":"2025-03-05T11:42:52.488Z","avatar_url":"https://github.com/drupol.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Phing Behat Task\n[![Build Status](https://travis-ci.org/drupol/phingbehattask.svg?branch=master)](https://travis-ci.org/drupol/phingbehattask)\n\nA Behat task for [Phing](http://www.phing.info/). This task enable usage of Behat commands in Phing build scripts.\n\nPhing provides tools for usual tasks for PHP projects (phplint, jslint, VCS checkouts, files copy or merge, packaging,\nupload, etc.). Integration of Behat in Phing is particularly useful when building and testing Drupal projects in a\ncontinuous integration server such as [Jenkins](http://jenkins-ci.org/), [Travis](https://travis-ci.org/)\nor [Continuous PHP](https://continuousphp.com/).\n \n## Installation\n\nInstallation must be done through [Composer](https://getcomposer.org/):\n\n```\n  composer require drupol/phingbehattask\n```\n\nor by editing your composer.json file and add in the right section:\n\n```json\n{\n  \"require\": {\n    \"drupol/phingbehattask\": \"dev-master\"\n  }\n}\n```\n\n## Usage\n\n### Behat task\n\nTo use the Behat task in your build file, it must be made available to Phing so that the buildfile parser is aware a\ncorrelating XML element and it's parameters.\n\nThis is done by adding a `\u003ctaskdef\u003e` task to your build file:\n\n```xml\n  \u003ctaskdef name=\"behat\" classname=\"\\Phing\\Behat\\Task\" /\u003e\n```\n\nor by importing the ```import.xml``` file: \n\n```xml\n  \u003cimport file=\"vendor/drupol/phingbehattask/import.xml\"/\u003e\n```\n\nOnce imported, you are able to use it:\n\n```xml\n  \u003cbehat bin=\"${project.basedir}/vendor/behat/behat/bin/behat\" haltonerror=\"yes\" colors=\"yes\" verbose=\"${behat.options.verbosity}\"\u003e\n    \u003coption name=\"config=\"\u003e${project.basedir}/tests/behat.yml\u003c/option\u003e \n  \u003c/behat\u003e\n```\n\nSee the [Phing documentation](http://www.phing.info/docs/guide/stable/chapters/appendixes/AppendixB-CoreTasks.html#TaskdefTask) for more information on the `\u003ctaskdef\u003e` task.\n\nAs the Phing Behat Task extends the Phing ExecTask, you are able to use all the options of that command.\n\nHave a look at [the ExecTask documentation](https://www.phing.info/docs/guide/trunk/ExecTask.html) for the complete list of options.\n\n### Behat load balancer task\n\nThe Behat load balancer task splits your feature files into an arbitrary number of Behat configuration files.\n \nTo use the Behat load balancer task in your build file, it must be made available to Phing so that the buildfile \nparser is aware a correlating XML element and it's parameters.\n\nThis is done by adding a `\u003ctaskdef\u003e` task to your build file:\n\n```xml\n  \u003ctaskdef name=\"behat:balancer\" classname=\"\\Phing\\Behat\\Balancer\" /\u003e\n```\n\nor by importing the ```import.xml``` file: \n\n```xml\n  \u003cimport file=\"vendor/drupol/phingbehattask/import.xml\"/\u003e\n```\n\nOnce imported, you are able to use it as follow:\n\n```xml\n  \u003cbehat:balancer\n    containers=\"5\"\n    root=\"/path/to/your/behat/features/directory\"\n    destination=\"/path/to/destination/directory\"\n    import=\"/path/to/base/behat/configuration/behat.yml\"\n  /\u003e\n```\n\nThe attributes have the following meaning:\n\n- `containers`: Number of Behat configuration files the feature files will be split into.\n- `root`: Path to your Behat `/features` directory.\n- `destination`: Destination directory in which the new behat files will be generated.\n- `import`: Main Behat configuration file to be imported in each of the generated file.\n\nYou can then configure your continuous integration to run one behat file per environment.\n\n## Filtering\n\nThe behat balancer also allows for filtering on tags when using multiple profiles.\n\nFiltering matches behat filtering [http://behat.org/en/latest/user_guide/configuration/suites.html#suite-filters]\n\nThe following example will first filter the features into profile specific features, by using the tags as a filter:\n  - default: NOT @wip AND NOT @profile AND NOT @login AND must contain @theme will only be included and then balanced.\n  - secondary_profile: NOT @secondary_profile AND NOT @api AND must contain @secondary_theme or the the text 'As a(n) administrator' will only be included and then balanced.\nThe filters are based on behat's filters and as such will also match any features that contain scenarios that are tagged.\n```xml\n  \u003cbehat:balancer\n    containers=\"5\"\n    root=\"/path/to/your/behat/features/directory\"\n    destination=\"/path/to/destination/directory\"\n    import=\"/path/to/base/behat/configuration/behat.yml\"\n  \u003e\n    \u003cfilters profile=\"default\"\u003e\n        \u003ctags\u003e\u003c![CDATA[ ~@wip\u0026\u0026~@profile\u0026\u0026~@login\u0026\u0026@theme ]]\u003e\u003c/tags\u003e\n    \u003c/filters\u003e\n    \u003cfilters profile=\"secondary_profile\"\u003e\n        \u003ctags\u003e\u003c![CDATA[ ~@secondary_profile\u0026\u0026~@api\u0026\u0026@secondary_theme ]]\u003e\u003c/tags\u003e\n        \u003crole\u003eadministrator\u003c/role\u003e\n    \u003c/filters\u003e\n  \u003c/behat:balancer\u003e\n```\n\nThe balanced files will generate files in the following format `behat.{profile}.{part}.yml` and will produce the output:\n```xml\nimports:\n  - {behat_configuration_file}\n{profile}:\n  suites:\n    default:\n      paths:\n        - {feature}\n        - {feature}\n```\n\nIf there are no filters, for backward compatibility the file name is `behat.{part}.yml`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupol%2Fphingbehattask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrupol%2Fphingbehattask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrupol%2Fphingbehattask/lists"}