{"url":"https://api.github.com/gists/0915e66662ba4182a35f","forks_url":"https://api.github.com/gists/0915e66662ba4182a35f/forks","commits_url":"https://api.github.com/gists/0915e66662ba4182a35f/commits","id":"0915e66662ba4182a35f","node_id":"MDQ6R2lzdDA5MTVlNjY2NjJiYTQxODJhMzVm","git_pull_url":"https://gist.github.com/0915e66662ba4182a35f.git","git_push_url":"https://gist.github.com/0915e66662ba4182a35f.git","html_url":"https://gist.github.com/michaellihs/0915e66662ba4182a35f","files":{"typo3_behat.md":{"filename":"typo3_behat.md","type":"text/markdown","language":"Markdown","raw_url":"https://gist.githubusercontent.com/michaellihs/0915e66662ba4182a35f/raw/a43902ddf863135fdf1c39ef8993228045dedb4c/typo3_behat.md","size":2681,"truncated":false,"content":"We have an extension PROJECT_NAME-testing, which holds a `composer.json` like this:\n\n````json\n{\n    \"name\": \"punktde/PROJECT_NAME-testing\",\n    \"description\" : \"punkt.de testing suite for PROJECT_NAME\",\n    \"license\": \"proprietary\",\n    \"repositories\": [\n        {\n            \"type\": \"git\",\n            \"url\": \"git@gitlab.pluspunkthosting.de:pt/punktde-testing.git\"\n        }\n    ],\n    \"autoload\": {\n       \"psr-4\": {\n           \"TYPO3\\\\Flow\\\\\": \"vendor/punktde/testing/Classes/PunktDe/Testing\"\n       }\n    },\n    \"require\": {\n        \"punktde/testing\": \"dev-master\"\n    },\n    \"scripts\": {\n        \"post-update-cmd\": \"PunktDe\\\\Testing\\\\Composer\\\\InstallerScripts::postUpdateAndInstall\",\n        \"post-install-cmd\": \"PunktDe\\\\Testing\\\\Composer\\\\InstallerScripts::postUpdateAndInstall\"\n    },\n    \"config\": {\n        \"bin-dir\": \"bin\"\n    }\n}\n````\n\nInside a generic composer package `punktde/testing`, we have another `composer.json` which looks like this:\n\n````json\n{\n    \"name\": \"punktde/testing\",\n    \"type\": \"typo3-flow-package\",\n    \"description\": \"punkt.de Testing\",\n    \"license\": \"LGPL-3.0+\",\n    \"require\": {\n        \"phpunit/dbunit\": \">=1.2\",\n\t\t\"mikey179/vfsStream\": \"~1\",\n        \"behat/behat\": \"3.0.11\",\n        \"behat/mink-extension\": \"2.0.0\",\n        \"behat/mink-selenium2-driver\": \"*\",\n        \"guzzle/guzzle\": \"3.9.2\"\n    },\n\t\"config\": {\n\t\t\"bin-dir\": \"bin/\"\n\t},\n    \"autoload\": {\n        \"psr-0\": {\n            \"PunktDe\\\\Testing\": \"Classes\"\n        }\n    }\n}\n````\n\nthat's where Behat is loaded into our extension directory structure. Finally, we get the following directory structure inside the project-specific testing extension:\n\n\n````\n.\n├── Fixtures\n├── Tests\n│   ├── Behat\n│   ├── Functional\n│   └── Selenium\n├── behat.yml\n├── bin\n│   ├── phpunit -> ../vendor/phpunit/phpunit/phpunit\n│   └── behat -> ../vendor/bin/behat\n├── composer.json\n├── composer.lock\n├── ext_emconf.php\n├── ext_icon.gif\n├── ext_localconf.php\n├── ext_tables.php\n└── vendor\n    ├── autoload.php\n    ├── behat\n    ├── bin\n    ├── composer\n    ├── doctrine\n    ├── guzzle\n    ├── instaclick\n    ├── mikey179\n    ├── phpunit\n    ├── punktde\n    ├── sebastian\n    └── symfony\n````\n\nWe can now run Behat from within this extension with `bin/behat PARAMETERS`\n\nSince TYPO3 7 I think you can use composer from the root of your TYPO3 installation - so I would rather put the whole Behat stuff outside any extension and into a `testing` directory on the same level as your `htdocs` folder.\n\nHope, this helps...","encoding":"utf-8"}},"public":true,"created_at":"2015-08-14T07:14:54Z","updated_at":"2017-11-03T15:28:24Z","description":"Behat in TYPO3","comments":0,"user":null,"comments_enabled":true,"comments_url":"https://api.github.com/gists/0915e66662ba4182a35f/comments","owner":{"login":"michaellihs","id":575011,"node_id":"MDQ6VXNlcjU3NTAxMQ==","avatar_url":"https://avatars.githubusercontent.com/u/575011?v=4","gravatar_id":"","url":"https://api.github.com/users/michaellihs","html_url":"https://github.com/michaellihs","followers_url":"https://api.github.com/users/michaellihs/followers","following_url":"https://api.github.com/users/michaellihs/following{/other_user}","gists_url":"https://api.github.com/users/michaellihs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellihs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellihs/subscriptions","organizations_url":"https://api.github.com/users/michaellihs/orgs","repos_url":"https://api.github.com/users/michaellihs/repos","events_url":"https://api.github.com/users/michaellihs/events{/privacy}","received_events_url":"https://api.github.com/users/michaellihs/received_events","type":"User","user_view_type":"public","site_admin":false},"forks":[],"history":[{"user":{"login":"michaellihs","id":575011,"node_id":"MDQ6VXNlcjU3NTAxMQ==","avatar_url":"https://avatars.githubusercontent.com/u/575011?v=4","gravatar_id":"","url":"https://api.github.com/users/michaellihs","html_url":"https://github.com/michaellihs","followers_url":"https://api.github.com/users/michaellihs/followers","following_url":"https://api.github.com/users/michaellihs/following{/other_user}","gists_url":"https://api.github.com/users/michaellihs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellihs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellihs/subscriptions","organizations_url":"https://api.github.com/users/michaellihs/orgs","repos_url":"https://api.github.com/users/michaellihs/repos","events_url":"https://api.github.com/users/michaellihs/events{/privacy}","received_events_url":"https://api.github.com/users/michaellihs/received_events","type":"User","user_view_type":"public","site_admin":false},"version":"498103bddfac35ab6c674cdff5e8615be06c75f6","committed_at":"2015-08-14T07:15:48Z","change_status":{"total":4,"additions":2,"deletions":2},"url":"https://api.github.com/gists/0915e66662ba4182a35f/498103bddfac35ab6c674cdff5e8615be06c75f6"},{"user":{"login":"michaellihs","id":575011,"node_id":"MDQ6VXNlcjU3NTAxMQ==","avatar_url":"https://avatars.githubusercontent.com/u/575011?v=4","gravatar_id":"","url":"https://api.github.com/users/michaellihs","html_url":"https://github.com/michaellihs","followers_url":"https://api.github.com/users/michaellihs/followers","following_url":"https://api.github.com/users/michaellihs/following{/other_user}","gists_url":"https://api.github.com/users/michaellihs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellihs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellihs/subscriptions","organizations_url":"https://api.github.com/users/michaellihs/orgs","repos_url":"https://api.github.com/users/michaellihs/repos","events_url":"https://api.github.com/users/michaellihs/events{/privacy}","received_events_url":"https://api.github.com/users/michaellihs/received_events","type":"User","user_view_type":"public","site_admin":false},"version":"bad7d7554536486be8df72239db7ee54accd680b","committed_at":"2015-08-14T07:15:23Z","change_status":{"total":2,"additions":1,"deletions":1},"url":"https://api.github.com/gists/0915e66662ba4182a35f/bad7d7554536486be8df72239db7ee54accd680b"},{"user":{"login":"michaellihs","id":575011,"node_id":"MDQ6VXNlcjU3NTAxMQ==","avatar_url":"https://avatars.githubusercontent.com/u/575011?v=4","gravatar_id":"","url":"https://api.github.com/users/michaellihs","html_url":"https://github.com/michaellihs","followers_url":"https://api.github.com/users/michaellihs/followers","following_url":"https://api.github.com/users/michaellihs/following{/other_user}","gists_url":"https://api.github.com/users/michaellihs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellihs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellihs/subscriptions","organizations_url":"https://api.github.com/users/michaellihs/orgs","repos_url":"https://api.github.com/users/michaellihs/repos","events_url":"https://api.github.com/users/michaellihs/events{/privacy}","received_events_url":"https://api.github.com/users/michaellihs/received_events","type":"User","user_view_type":"public","site_admin":false},"version":"ad6728b805328f63d35f4013d9430705c1c71678","committed_at":"2015-08-14T07:15:12Z","change_status":{"total":0,"additions":0,"deletions":0},"url":"https://api.github.com/gists/0915e66662ba4182a35f/ad6728b805328f63d35f4013d9430705c1c71678"},{"user":{"login":"michaellihs","id":575011,"node_id":"MDQ6VXNlcjU3NTAxMQ==","avatar_url":"https://avatars.githubusercontent.com/u/575011?v=4","gravatar_id":"","url":"https://api.github.com/users/michaellihs","html_url":"https://github.com/michaellihs","followers_url":"https://api.github.com/users/michaellihs/followers","following_url":"https://api.github.com/users/michaellihs/following{/other_user}","gists_url":"https://api.github.com/users/michaellihs/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellihs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellihs/subscriptions","organizations_url":"https://api.github.com/users/michaellihs/orgs","repos_url":"https://api.github.com/users/michaellihs/repos","events_url":"https://api.github.com/users/michaellihs/events{/privacy}","received_events_url":"https://api.github.com/users/michaellihs/received_events","type":"User","user_view_type":"public","site_admin":false},"version":"787fbd3640717190a53d6e82b97c1cc68d110c24","committed_at":"2015-08-14T07:14:54Z","change_status":{"total":98,"additions":98,"deletions":0},"url":"https://api.github.com/gists/0915e66662ba4182a35f/787fbd3640717190a53d6e82b97c1cc68d110c24"}],"truncated":false}