{"id":13549356,"url":"https://github.com/johnbillion/WordPressBehatExtension","last_synced_at":"2025-04-02T22:31:45.306Z","repository":{"id":30411031,"uuid":"33963881","full_name":"johnbillion/WordPressBehatExtension","owner":"johnbillion","description":"This package is no longer maintained. Use WordHat instead.","archived":true,"fork":true,"pushed_at":"2017-05-27T12:02:19.000Z","size":55,"stargazers_count":19,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T03:05:48.272Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wordhat.info","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tmf/WordPressExtension","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnbillion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-15T00:19:50.000Z","updated_at":"2023-01-28T19:07:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/johnbillion/WordPressBehatExtension","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbillion%2FWordPressBehatExtension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbillion%2FWordPressBehatExtension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbillion%2FWordPressBehatExtension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnbillion%2FWordPressBehatExtension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnbillion","download_url":"https://codeload.github.com/johnbillion/WordPressBehatExtension/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246905231,"owners_count":20852812,"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-08-01T12:01:20.962Z","updated_at":"2025-04-02T22:31:44.984Z","avatar_url":"https://github.com/johnbillion.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"WordPress Extension for Behat 3\n===============================\n\nThis is a Behat 3.0 Extension for WordPress plugin and theme development. \nYou can use it to test your WordPress installation, or just test your plugin/theme without installing them in a normal WordPress installation (i.e. stand-alone).\nThe Extension allows you to use WordPress functions in your context class (if you extend it from Johnbillion\\WordPressExtension\\Context\\WordPressContext).\n\nInstallation\n------------\n\n1. Add a composer development requirement for your WordPress theme or plugin:\n\n    ```json\n    {\n        \"require-dev\" : {\n            \"johnbillion/wordpress-behat-extension\": \"~0.1\",\n            \"johnpbloch/wordpress\": \"~4.0.0\"\n        }\n    }\n    ```\n\n2. Add the following Behat configuration file:\n\n    ```yml\n    default:\n      suites:\n        default:\n          contexts:\n            - Johnbillion\\WordPressExtension\\Context\\WordPressContext\n      extensions:\n        Johnbillion\\WordPressExtension:\n          path: '%paths.base/vendor/wordpress'\n    \n        Behat\\MinkExtension:\n          base_url:    'http://localhost:8000'\n          sessions:\n            default:\n              goutte: ~\n    \n    ```\n\n3. Install the vendors and initialize behat test suites\n\n    ```bash\n    composer update\n    vendor/bin/behat --init\n    ```\n\n4. Start your development web server and point its document root to the wordpress directory in vendors (without mail function)\n\n    ```bash\n    php -S localhost:8000 -t vendor/wordpress -d disable_functions=mail\n    ```\n\n5. Write some Behat features and test them\n\n    ```\n    Feature: Manage plugins\n        In order to manage plugins\n        As an admin\n        I need to enable and disable plugins\n    \n        Background:\n            Given I have a vanilla wordpress installation\n                | name          | email                   | username | password |\n                | BDD WordPress | your@email.com          | admin    | test     |\n            And I am logged in as \"admin\" with password \"test\"\n    \n        Scenario: Enable the dolly plugin\n            Given there are plugins\n                | plugin    | status  |\n                | hello.php | enabled |\n            When I go to \"/wp-admin/\"\n            Then I should see a \"#dolly\" element\n    \n        Scenario: Disable the dolly plugin\n            Given there are plugins\n                | plugin    | status   |\n                | hello.php | disabled |\n            When I go to \"/wp-admin/\"\n            Then I should not see a \"#dolly\" element\n    \n    ```\n\n6. Run the tests\n\n    ```bash\n    vendor/bin/behat\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnbillion%2FWordPressBehatExtension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnbillion%2FWordPressBehatExtension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnbillion%2FWordPressBehatExtension/lists"}