{"id":20339807,"url":"https://github.com/minkphp/driver-testsuite","last_synced_at":"2025-04-05T16:08:37.175Z","repository":{"id":11354189,"uuid":"69404081","full_name":"minkphp/driver-testsuite","owner":"minkphp","description":"Functional testsuite for Mink drivers","archived":false,"fork":false,"pushed_at":"2025-01-13T11:18:17.000Z","size":204,"stargazers_count":8,"open_issues_count":12,"forks_count":28,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T15:08:28.888Z","etag":null,"topics":["mink","php","testsuite"],"latest_commit_sha":null,"homepage":null,"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/minkphp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-27T22:30:47.000Z","updated_at":"2025-01-13T11:18:22.000Z","dependencies_parsed_at":"2024-02-27T10:16:14.866Z","dependency_job_id":"635bc573-0ad6-4f43-ba29-9853fceece73","html_url":"https://github.com/minkphp/driver-testsuite","commit_stats":{"total_commits":53,"total_committers":15,"mean_commits":3.533333333333333,"dds":"0.49056603773584906","last_synced_commit":"9f2fb574d83290fe3bda88d1933669f3a830f618"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minkphp%2Fdriver-testsuite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minkphp%2Fdriver-testsuite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minkphp%2Fdriver-testsuite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minkphp%2Fdriver-testsuite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minkphp","download_url":"https://codeload.github.com/minkphp/driver-testsuite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361691,"owners_count":20926643,"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":["mink","php","testsuite"],"created_at":"2024-11-14T21:18:34.381Z","updated_at":"2025-04-05T16:08:37.150Z","avatar_url":"https://github.com/minkphp.png","language":"PHP","readme":"Mink Driver testsuite\n=====================\n\nThis is the common testsuite for Mink drivers to ensure consistency among implementations.\n\nUsage\n-----\n\nThe testsuite of a driver should be based as follow:\n\n```json\n{\n    \"require\": {\n        \"behat/mink\": \"^1.9\"\n    },\n\n    \"require-dev\": {\n        \"mink/driver-testsuite\": \"dev-master\",\n        \"phpunit/phpunit\": \"^8.5.22 || ^9.5.11\"\n    },\n\n    \"autoload-dev\": {\n        \"psr-4\": {\n            \"Acme\\\\MyDriver\\\\Tests\\\\\": \"tests\"\n        }\n    }\n}\n```\n\nThe PHPUnit config should look like this:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\n\u003cphpunit colors=\"true\" bootstrap=\"vendor/autoload.php\"\u003e\n    \u003cphp\u003e\n        \u003cvar name=\"driver_config_factory\" value=\"Acme\\MyDriver\\Tests\\Config::getInstance\" /\u003e\n    \u003c/php\u003e\n\n    \u003ctestsuites\u003e\n        \u003ctestsuite name=\"Functional tests\"\u003e\n            \u003cdirectory\u003evendor/mink/driver-testsuite/tests\u003c/directory\u003e\n        \u003c/testsuite\u003e\n        \u003c!-- if needed to add more tests --\u003e\n        \u003ctestsuite name=\"Driver tests\"\u003e\n            \u003cdirectory\u003e./tests/\u003c/directory\u003e\n        \u003c/testsuite\u003e\n    \u003c/testsuites\u003e\n\n    \u003cfilter\u003e\n        \u003cwhitelist\u003e\n            \u003cdirectory\u003e./src\u003c/directory\u003e\n        \u003c/whitelist\u003e\n    \u003c/filter\u003e\n\n    \u003clisteners\u003e\n        \u003clistener class=\"Symfony\\Bridge\\PhpUnit\\SymfonyTestsListener\"/\u003e\n    \u003c/listeners\u003e\n\u003c/phpunit\u003e\n```\n\nThen create the driver config for the testsuite:\n\n```php\n// tests/Config.php\n\nnamespace Acme\\MyDriver\\Tests;\n\nuse Behat\\Mink\\Tests\\Driver\\AbstractConfig;\n\nclass Config extends AbstractConfig\n{\n    /**\n     * Creates an instance of the config.\n     *\n     * This is the callable registered as a php variable in the phpunit.xml config file.\n     * It could be outside the class but this is convenient.\n     */\n    public static function getInstance()\n    {\n        return new self();\n    }\n\n    /**\n     * Creates driver instance.\n     *\n     * @return \\Behat\\Mink\\Driver\\DriverInterface\n     */\n    public function createDriver()\n    {\n        return new \\Acme\\MyDriver\\MyDriver();\n    }\n}\n```\n\nSome other methods are available in the AbstractConfig which can be overwritten to adapt the testsuite to\nthe needs of the driver (skipping some tests for instance).\n\nRunning tests\n-------------\n\nBefore running tests, you need to start the webserver exposing the web fixtures (unless the driver does\nnot perform real HTTP requests). This is done using this command:\n\n```bash\n$ vendor/bin/mink-test-server\n```\n\nTo stop the server at the end of tests, cancel the command.\n\n\u003e Note: this command requires Bash. If you are on Windows, use either GitBash or Cygwin (or another\n\u003e equivalent tool) to launch it.\n\u003e\n\u003e This command also requires PHP 5.4+ to be able to use the builtin webserver. If the PHP version available\n\u003e in the PATH is a different one, use the `MINK_PHP_BIN` env variable to select a different PHP runtime.\n\nYou can now run tests for your driver with `vendor/bin/phpunit`.\nThis package installs PHPUnit as a dependency to ensure that a version of PHPUnit compatible with the testsuite is used.\n\nAdding Driver-specific Tests\n----------------------------\n\nWhen adding extra test cases specific to the driver, either use your own namespace or put them in the\n`Behat\\Mink\\Tests\\Driver\\Custom` subnamespace to ensure that you will not create conflicts with test cases\nadded in the driver testsuite in the future.\nWhen the driver has its own tests, it is recommended to add the dev requirement on `phpunit/phpunit` to\nensure that the tests are compatible with phpunit even if driver-testsuite adds support for newer versions.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminkphp%2Fdriver-testsuite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminkphp%2Fdriver-testsuite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminkphp%2Fdriver-testsuite/lists"}