Skip to content

Overview

TestHelper adds a browseable developer backend at /test-helper for your CakePHP app, collecting several day-to-day tools in one place.

TestHelper dashboard

TIP

Everything here is a development aid — mount it behind your admin/dev gate. See Configuration for the authorization and back-link options.

Tools

ToolWhat it does
Association vs DB AuditCompare declared associations against the real database foreign keys, with copy-paste fixes
SQL to Query BuilderConvert raw SQL into CakePHP Query Builder code
Test RunnerRun tests and view results/coverage in the backend; bake missing test files
Fixture CheckCompare fixtures against the live DB schema
URL ToolsGenerate URL arrays from string URLs (reverse lookup)
Plugin InfoInspect plugins, their hooks, and suggested improvements
Custom Linter TasksProject-specific code-quality checks via bin/cake linter

Requirements

  • PHP 8.2+
  • CakePHP 5.1+

Installation

bash
composer require --dev dereuromark/cakephp-test-helper

Load the plugin (development only):

php
// src/Application.php
public function bootstrap(): void
{
    parent::bootstrap();

    if (Configure::read('debug')) {
        $this->addPlugin('TestHelper');
    }
}

Then browse to /test-helper.

See Configuration for the available options and Troubleshooting if something doesn't render.

Released under the MIT License.