{"id":24815487,"url":"https://github.com/try-php/predict-output","last_synced_at":"2025-03-25T18:42:20.962Z","repository":{"id":57073117,"uuid":"107792746","full_name":"try-php/predict-output","owner":"try-php","description":"Prediction package for CLI output","archived":false,"fork":false,"pushed_at":"2017-10-21T15:50:04.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T16:37:42.452Z","etag":null,"topics":["php7","test","testing","tryphp"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/try-php.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-10-21T15:40:23.000Z","updated_at":"2022-02-12T08:30:37.000Z","dependencies_parsed_at":"2022-08-24T14:54:39.895Z","dependency_job_id":null,"html_url":"https://github.com/try-php/predict-output","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/try-php%2Fpredict-output","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/try-php%2Fpredict-output/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/try-php%2Fpredict-output/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/try-php%2Fpredict-output/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/try-php","download_url":"https://codeload.github.com/try-php/predict-output/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245525198,"owners_count":20629808,"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":["php7","test","testing","tryphp"],"created_at":"2025-01-30T16:29:52.769Z","updated_at":"2025-03-25T18:42:20.956Z","avatar_url":"https://github.com/try-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# predict-output\n\n\u003e Prediction package for CLI output\n\n[![Build Status](https://travis-ci.org/try-php/predict-output.svg?branch=master)](https://travis-ci.org/try-php/predict-output)\n\n## Install\n\n```bash\n$ composer require try/predict-output\n```\n\n## Usage\n\n```php\n\u003c?php\nrequire_once '/path/to/autoload.php';\n\nuse TryPhp\\PredictOutputTrait;\n\n$assertions = new class() {\n\tuse PredictOutputTrait();\n} \n\n$assertions-\u003epredictOutput(function () {\n\techo '\\e[33msomething\\n';\n}, 'something'); // won't throw an exception\n\n$assertions-\u003epredictOutput(function () {\n\techo '\\e[33msomething\\n';\n}, 'something other'); // will throw an exception\n```\n\n## API\n\n### Methods\n\n#### `predictOutput($capture, $content)`\n\nMethod to compare an output capture with a given string.\n\n##### Arguments\n\n| Arguments | Type | Description |\n|---|---|---|\n| $capture | `callable` | Closure from which every output buffer write will be captured. |\n| $content | `string` | Content to which the output will be compared to. |\n\n## License\n\nGPL-2.0 © Willi Eßer","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftry-php%2Fpredict-output","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftry-php%2Fpredict-output","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftry-php%2Fpredict-output/lists"}