feat: add comprehensive unit testing support for CakePHP
- Add 4 CakePHP Claude Code skills: cakephp-unit-test, cakephp-test-setup, cakephp-test-review, cakephp-mock-helper - Add 11 CakePHP PHPUnit component templates (Table, Entity, Controller, Service, Command, Component, Middleware, Mailer, Form, Behavior, Helper) - Add CakePHP configs (phpunit.xml.dist, app_local.test.php for SQLite in-memory) - Add comprehensive CakePHP documentation and component guides - Update test-runner.sh and installer to auto-detect Laravel and CakePHP - Add CakePHP CI/CD templates for GitHub Actions and GitLab CI - Update system prompt, verification checklist, and README with dedicated guides
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Test\TestCase\View\Helper;
|
||||
|
||||
use App\View\Helper\{{HELPER_NAME}}Helper;
|
||||
use Cake\TestSuite\TestCase;
|
||||
use Cake\View\View;
|
||||
|
||||
/**
|
||||
* App\View\Helper\{{HELPER_NAME}}Helper Test Case
|
||||
*/
|
||||
class {{HELPER_NAME}}HelperTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var \App\View\Helper\{{HELPER_NAME}}Helper
|
||||
*/
|
||||
protected {{HELPER_NAME}}Helper ${{VARIABLE_NAME}};
|
||||
|
||||
/**
|
||||
* setUp method
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$view = new View();
|
||||
$this->{{VARIABLE_NAME}} = new {{HELPER_NAME}}Helper($view);
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDown method
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->{{VARIABLE_NAME}});
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test helper initialization and rendering
|
||||
*/
|
||||
public function testInitialization(): void
|
||||
{
|
||||
$this->assertInstanceOf({{HELPER_NAME}}Helper::class, $this->{{VARIABLE_NAME}});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user