{"id":15143866,"url":"https://github.com/shockedplot7560/pmmpunit","last_synced_at":"2025-10-23T20:31:12.006Z","repository":{"id":196167592,"uuid":"694824141","full_name":"ShockedPlot7560/PmmpUnit","owner":"ShockedPlot7560","description":"Integration testing framework for PocketMine-MP","archived":false,"fork":false,"pushed_at":"2024-08-06T08:26:47.000Z","size":351,"stargazers_count":8,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"stable","last_synced_at":"2024-10-29T22:08:16.034Z","etag":null,"topics":["developer-tools","development","integration-testing","pocketmine"],"latest_commit_sha":null,"homepage":"","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/ShockedPlot7560.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-09-21T19:12:01.000Z","updated_at":"2024-08-06T08:26:28.000Z","dependencies_parsed_at":"2023-09-22T04:49:07.078Z","dependency_job_id":"fc3c66ae-da56-481d-b3bf-a11833b6e01d","html_url":"https://github.com/ShockedPlot7560/PmmpUnit","commit_stats":null,"previous_names":["shockedplot7560/pmunittest","shockedplot7560/pmmpunit"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShockedPlot7560%2FPmmpUnit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShockedPlot7560%2FPmmpUnit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShockedPlot7560%2FPmmpUnit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShockedPlot7560%2FPmmpUnit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShockedPlot7560","download_url":"https://codeload.github.com/ShockedPlot7560/PmmpUnit/tar.gz/refs/heads/stable","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237882172,"owners_count":19381176,"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":["developer-tools","development","integration-testing","pocketmine"],"created_at":"2024-09-26T10:20:20.309Z","updated_at":"2025-10-23T20:31:06.673Z","avatar_url":"https://github.com/ShockedPlot7560.png","language":"PHP","readme":"## PmIntegration - Integration Testing Framework for PocketMine\r\n\r\n**Run only on Unix (Linux, Mac)**\r\n\r\nThis plugin has been created with the sole aim of making integration and functional tests possible during the pocketmine runtime.\r\n\r\nIt can be used to correctly test the expected result of a command executed by a fake player, interaction with events and multi-threading support.\r\n\r\nTests are run asynchronously using promises to enable support with different systems in place. The libraries used for the promises are : [ReactPHP/promise](https://github.com/reactphp/promise)\r\n\r\n\u003e [!WARNING]\r\n\u003e This plugin should not be used in production, as it will shutdown the server as soon as testing is complete.\r\n\r\n## Installation\r\n\r\nUsing of official docker image is strongly recommended.\r\n\r\nMount your tests in `/data/plugin_data/PmmpUnit/tests/` and copy your plugin in `/plugins/`.\r\n\r\nExemple:\r\n```bash\r\ndocker run -it --rm \\\r\n  -v /tests/pmmpunit/suitetest/normal/tests:/data/plugin_data/PmmpUnit/tests/ \\\r\n  # -v /path/to/plugin:/plugins/ \\\r\n  --name pmunit-test \\\r\n  ghcr.io/shockedplot7560/pmmpunit/tests-runner:latest\r\n```\r\n\r\n\u003e [!NOTE]\r\n\u003e An action to simplify the execution of integration tests in a github workflow should be available soon.\r\n\r\n## Utilisation\r\n\r\nTests are retrieved from the folder: `plugin_data/PmmpUnit/tests/` and are executed when the server start.\r\n\r\nAll test classes must inherit from `ShockedPlot7560\\PmmpUnit\\framework\\TestCase`.  \r\nAll test methods must be prefixed with `test` and must not have any parameters, it must return a `PromiseInterface\u003cnull\u003e`.  \r\nIf the code is executed synchronously and does not have to wait for a result, use `resolve(null)`.\r\nUse `Deferred` instead for asynchronous code and `$deferred-\u003eresolve(null)` to resolve the promise.\r\n\r\nEach test class can execute code when the server is `onLoad`, `onEnable` or `onDisable`. Simply use the corresponding classes.\r\n\r\n`setUp` and `tearDown` are called when each class test is run, respectively before and after the test, whatever the result.\r\n\r\n\u003e For exemple tests, look at `tests/pmmpunit/suitetest/*/tests`\r\n\r\n### TestPlayer utilisation\r\n\r\nTo retrieve one player during a test, call ``getPlayer()``.   \r\nTo test player commands or behavior, create your promise/listener before executing the action. Return the promise in the test method.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshockedplot7560%2Fpmmpunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshockedplot7560%2Fpmmpunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshockedplot7560%2Fpmmpunit/lists"}