{"id":13684193,"url":"https://github.com/dereuromark/cakephp-test-helper","last_synced_at":"2026-02-07T16:06:02.485Z","repository":{"id":47013605,"uuid":"122780973","full_name":"dereuromark/cakephp-test-helper","owner":"dereuromark","description":"Helper plugin around CakePHP testing and TDD as browser backend","archived":false,"fork":false,"pushed_at":"2026-02-06T23:54:04.000Z","size":921,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-07T10:39:29.048Z","etag":null,"topics":[],"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/dereuromark.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-02-24T21:23:19.000Z","updated_at":"2026-02-06T23:54:07.000Z","dependencies_parsed_at":"2023-02-08T20:31:07.893Z","dependency_job_id":"74849c7b-fea2-47b7-9974-97e03361faae","html_url":"https://github.com/dereuromark/cakephp-test-helper","commit_stats":{"total_commits":139,"total_committers":4,"mean_commits":34.75,"dds":0.3093525179856115,"last_synced_commit":"f7c5291bfe85f5d77792ba182432bcd64bedeeea"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/dereuromark/cakephp-test-helper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-test-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-test-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-test-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-test-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dereuromark","download_url":"https://codeload.github.com/dereuromark/cakephp-test-helper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-test-helper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29199519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T14:35:27.868Z","status":"ssl_error","status_checked_at":"2026-02-07T14:25:51.081Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-08-02T14:00:30.711Z","updated_at":"2026-02-07T16:06:02.480Z","avatar_url":"https://github.com/dereuromark.png","language":"PHP","funding_links":[],"categories":["Code Analysis","Plugins"],"sub_categories":["Code Analysis"],"readme":"# CakePHP TestHelper plugin\n[![CI](https://github.com/dereuromark/cakephp-test-helper/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/dereuromark/cakephp-test-helper/actions/workflows/ci.yml?query=branch%3Amaster)\n[![Coverage Status](https://img.shields.io/codecov/c/github/dereuromark/cakephp-test-helper/master.svg)](https://codecov.io/github/dereuromark/cakephp-test-helper/branch/master)\n[![Latest Stable Version](https://poser.pugx.org/dereuromark/cakephp-test-helper/v/stable.svg)](https://packagist.org/packages/dereuromark/cakephp-test-helper)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.2-8892BF.svg)](https://php.net/)\n[![License](https://poser.pugx.org/dereuromark/cakephp-test-helper/license.svg)](LICENSE)\n[![Total Downloads](https://poser.pugx.org/dereuromark/cakephp-test-helper/d/total)](https://packagist.org/packages/dereuromark/cakephp-test-helper)\n[![Coding Standards](https://img.shields.io/badge/cs-PSR--2--R-yellow.svg)](https://github.com/php-fig-rectified/fig-rectified-standards)\n\nBrowser based addons for your test driven development.\n\nNote: This branch is for **CakePHP 5.1+**. See [version map](https://github.com/dereuromark/cakephp-test-helper/wiki#cakephp-version-map) for details.\n\n## Motivation\nAfter 2.x=\u003e3.x, the \"web-tester\" has been removed. It was, for certain cases, however, quite useful.\nThis aims to bring back a part of it.\n\nThe CLI also doesn't allow a good overview. Even with auto-complete, you have to type almost everything out.\nWith a browser backend generating tests or running them is just a simple mouse click.\n\nYou have an overview of your classes and the test classes to it. If there is one missing, you can easily \"bake\" it from this web backend. It internally uses [Bake](https://github.com/cakephp/bake/) plugin as well as your preferred theme.\n\n### Further useful addons\n* **SQL to Query Builder Converter** - Convert raw SQL to CakePHP Query Builder code with full features\n* URL array generation from string URLs (respects routing, so it is basically also a reverse lookup)\n* Fixture validation tool (compares actual DB with the schema files: fields and attributes, constraints and indexes)\n* Model/entity/table comparison overview.\n* GUI for fixture comparison and generation of missing ones per mouse click.\n* Custom linter tasks for project-specific code quality checks.\n\n![Dashboard](docs/img/dashboard.png)\n\n## Installation\n\nYou can install this plugin into your CakePHP application using [composer](https://getcomposer.org):\n```\ncomposer require --dev dereuromark/cakephp-test-helper\n```\n\nNote: This is not meant for production, so make sure you use the `--dev` flag and install it as development-only tool.\n\n## Setup\n\nLoad the plugin:\n```\nbin/cake plugin load TestHelper --only-debug\n```\n\nThis will also load the routes.\n\n### Authorization Plugin\n\nIf you are using the [CakePHP Authorization plugin](https://github.com/cakephp/authorization), you need to configure TestHelper to bypass authorization checks. Add this to your `config/bootstrap.php`:\n\n```php\nConfigure::write('TestHelper.ignoreAuthorization', true);\n```\n\nThis is similar to how DebugKit handles authorization and is necessary to prevent `AuthorizationRequiredException` errors when accessing TestHelper routes.\n\n### non-dev mode\nIn certain apps it can be useful to have some of the helper functionality available also for staging and prod.\nHere you must make sure then to not load the routes, though:\n```php\n$this-\u003eaddPlugin('TestHelper', ['routes' =\u003e Configure::read('debug')]);\n```\nAnd here you must use `composer require` without `--dev` flag then.\n\n## Usage\nNavigate to `/test-helper` backend and select the app or plugin you want to check.\nYou can then with a single click\n- check what classes do not yet have a test case\n- generate a test case for them (or copy and paste a generated code into CLI)\n- run test case\n- check coverage on a tested class, as overall and in detail\n\nSupported class types:\n\n* [x] Controllers\n* [x] Models (Tables/Entities)\n* [x] Components\n* [x] Behavior\n* [x] Helpers\n* [x] Commands\n* [x] Tasks\n* [x] Cells\n* [x] CommandHelpers\n* [x] Forms\n* [x] Mailers\n\n[Full Documentation](docs/README.md)\n\n## Custom Linter Tasks\n\nThe plugin includes a flexible linter system for running project-specific code quality checks.\n\n```bash\nbin/cake linter\n```\n\nSee [Linter Documentation](docs/Linter.md) for details on creating custom tasks, configuration, and included default tasks.\n\n## SQL to Query Builder Converter\n\nConvert raw SQL queries to CakePHP Query Builder code with just a click! Navigate to `/test-helper/query-builder` to access this powerful tool.\n\n**Features:**\n* ✅ **Comprehensive SQL Support**: SELECT, INSERT, UPDATE, DELETE with complex conditions\n* ✅ **String Functions**: CONCAT, SUBSTRING, TRIM, UPPER, LOWER, COALESCE\n* ✅ **Date Functions**: NOW, YEAR, MONTH, DATEDIFF, DATE_FORMAT\n* ✅ **Advanced Features**: CASE expressions, subqueries, window functions, CTEs\n* ✅ **JOINs**: INNER, LEFT, RIGHT with complex ON conditions\n* ✅ **Syntax Highlighting**: Prism.js for SQL and PHP code\n* ✅ **Production Ready**: Generates clean, idiomatic CakePHP code\n\n**Example:**\n```sql\nSELECT CONCAT(first_name, ' ', last_name) AS full_name,\n       COUNT(posts.id) AS post_count\nFROM users\nLEFT JOIN posts ON posts.user_id = users.id\nWHERE users.active = 1\nGROUP BY users.id\nHAVING COUNT(posts.id) \u003e 5\n```\n\nInstantly converts to:\n```php\n$query = $this-\u003efind()\n    -\u003eselect(function ($query) {\n        return [\n            'full_name' =\u003e $query-\u003efunc()-\u003econcat(['first_name', \"' '\", 'last_name']),\n            'post_count' =\u003e $query-\u003efunc()-\u003ecount('posts.id')\n        ];\n    })\n    -\u003eleftJoin(['Posts' =\u003e 'posts'], 'posts.user_id = users.id')\n    -\u003ewhere(['users.active' =\u003e 1])\n    -\u003egroupBy(['users.id'])\n    -\u003ehaving(['COUNT(posts.id) \u003e' =\u003e 5]);\n```\n\nSee [SQL Converter Documentation](docs/SqlConverter.md) for complete guide and examples.\n\n## Limitations\nExecuting the tests and coverage from the web backend usually can not work for long-running tests due to the timeout issues.\nMake sure you raise the apache/nginx settings here if you want to use this functionality here.\n\nThe focus is on providing an overview and quickly generating the desired classes with a single mouse click.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdereuromark%2Fcakephp-test-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdereuromark%2Fcakephp-test-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdereuromark%2Fcakephp-test-helper/lists"}