{"id":20779554,"url":"https://github.com/nathangibbs3/cptgenerate","last_synced_at":"2026-04-19T22:33:21.683Z","repository":{"id":87713970,"uuid":"184694724","full_name":"NathanGibbs3/cptgenerate","owner":"NathanGibbs3","description":"JIT PHPUnit Test Generation. Build Unit tests for diverse PHPUnit versions from a master set of PHPUnit tests.","archived":false,"fork":false,"pushed_at":"2020-08-28T18:16:08.000Z","size":21,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T10:49:10.487Z","etag":null,"topics":["automation","build-tool","jit","php","phpunit","phpunit-tests","test-generation"],"latest_commit_sha":null,"homepage":"","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/NathanGibbs3.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-03T03:43:11.000Z","updated_at":"2020-08-28T18:14:53.000Z","dependencies_parsed_at":"2023-03-02T11:30:23.141Z","dependency_job_id":null,"html_url":"https://github.com/NathanGibbs3/cptgenerate","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/NathanGibbs3/cptgenerate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NathanGibbs3%2Fcptgenerate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NathanGibbs3%2Fcptgenerate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NathanGibbs3%2Fcptgenerate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NathanGibbs3%2Fcptgenerate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NathanGibbs3","download_url":"https://codeload.github.com/NathanGibbs3/cptgenerate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NathanGibbs3%2Fcptgenerate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32025764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["automation","build-tool","jit","php","phpunit","phpunit-tests","test-generation"],"created_at":"2024-11-17T13:28:27.141Z","updated_at":"2026-04-19T22:33:21.652Z","avatar_url":"https://github.com/NathanGibbs3.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--README.md file for Github Repo--\u003e\n# cptgenerate -- JIT PHPUnit Test Generation [![Build Status](https://travis-ci.com/NathanGibbs3/cptgenerate.svg?branch=master)](https://travis-ci.com/NathanGibbs3/cptgenerate)\nBuild Unit tests for diverse PHPUnit versions from a master set of PHPUnit\ntests.\n\nGenerates a single set of Unit tests based on supplied PHPUnit version or\nmultiple test sets that can be run by PHPUnit based on installed PHP version.\n\n## Build Status\nmaster [![Build Status](https://travis-ci.com/NathanGibbs3/cptgenerate.svg?branch=master)](https://travis-ci.com/NathanGibbs3/cptgenerate)\ndevel [![Build Status](https://travis-ci.com/NathanGibbs3/cptgenerate.svg?branch=devel)](https://travis-ci.com/NathanGibbs3/cptgenerate)\n\n## This project enables developers to:\n1. Build with all default PHP Major.Minor versions available on travis-ci.\n1. Build with default PHP/PHPUnit combinations avaliable on travis-ci.\n1. Maintain one set of Unit tests.\n1. Spend less time maintaining Unit tests.\n1. Spend more time writing code. :smile:\n\n# History:\nWhile working on [BASE](https://github.com/NathanGibbs3/BASE), we ended up\nwith test sets for 3 different versions of PHPUnit. Occasionally, builds\nfailed or did not have uniform code coverage as maintaining the Unit test sets\nwas a manual process. Local testing in VM's also raised issues with\nPHP/PHPUnit combinations not seen via CI. Additionally, ~90% of the code\nin each Unit test set was identical.\n\n## The differnences between each test set were:\n1. Class defines.\n   1. Namespaced.\n   1. Non-Namespaced.\n1. Test fixture defines.\n   1. Typehinted.\n   1. Non-Typehinted.\n\n## The solution:\n`cptgenerate` which builds, from a master set of PHPUnit tests, a set of tests\ncompatible with the PHPUnit version used in the test environment. Basically,\n**JIT PHPUnit Test generation.**\n\n# Usage:\nCommand Line Options are space sepearated. All locations are relative to\nexecution dir.\n\n## Options:\n1. Location of Master Test Set ( defaults to tests/php );\n1. Location of Test Build ( defaults to tests/PhpUnit );\n\n   If set to \"multi\" will search for multiple Test set locations\n   formated as tests/phpX.X\n\n   Dir | Namespace | Typehint\n   ---|---|---\n   tests/php5.2 | No | No\n   tests/php7.1 | Yes | Yes\n   tests/php*.* | Yes | No\n\n1. PHPUnit Version ( defaults to 0.0.0 )\n\n## Examples:\nCommand|Master Tests|Generated Tests\n---|---|---\n`php -f ./tests/phptestgen.php` | In ./tests/php | In ./tests/PhpUnit\n`php -f ./tests/phptestgen.php LocA` | In ./tests/LocA | In ./tests/PhpUnit\n`php -f ./tests/phptestgen.php LocA LocB` | In ./tests/LocA | In ./tests/LocB\n`php -f ./tests/phptestgen.php LocA multi` | In ./tests/LocA | In ./tests/php*.* with customizations.\n\nWith a PHPUnit version specified as ( X.Y.Z ), the above examples will\ngenerate customized tests.\n\nPHPUnit Version | Namespace | Typehint\n---|---|---\n0.0.0 default value when not specified | Yes | No\n\u003c 4.8.28 | No | No\n4.8.28+ to \u003c 7.0 | Yes | No\n7.0+ | Yes | Yes\n\n# Related Software\n[PHPUnit](https://github.com/sebastianbergmann/phpunit) by\n[@sebastianbergmann](https://github.com/sebastianbergmann)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathangibbs3%2Fcptgenerate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathangibbs3%2Fcptgenerate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathangibbs3%2Fcptgenerate/lists"}