원클릭으로
testing
PHPUnit and Pest setup, running tests, database-backed tests, and lightweight test patterns for the Towerify project.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
PHPUnit and Pest setup, running tests, database-backed tests, and lightweight test patterns for the Towerify project.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Project setup, build tooling, Laravel/Wave structure, navigation/page placement, API registration, and asset conventions.
Common runtime, testing, and asset pipeline issues for the Towerify project.
Simplifies and refines PHP/Laravel code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise.
| name | testing |
| description | PHPUnit and Pest setup, running tests, database-backed tests, and lightweight test patterns for the Towerify project. |
Use this skill when adding, running, or debugging tests. Towerify uses both PHPUnit and Pest.
phpunit.xml).tests/Unit and tests/Feature.vendor/autoload.php (no Laravel kernel boot in the default bootstrap).phpunit.xml forces APP_ENV=testing and provides an application key. It also defines DB credentials for MySQL tests.tests/Pest.php configures Pest behaviors and base classes for different directories.Illuminate\Support\Facades\Http::fake() for API mocks and Illuminate\Support\Facades\Config::set() to override settings during tests.vendor/bin/pestvendor/bin/phpunitvendor/bin/pest tests/Unit/SmokeTest.phpvendor/bin/pest --coverageFastRefreshDatabase in tests/TestCaseWithDb.php.CREATE DATABASE tw_testdb DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE USER 'tw_testuser'@'localhost' IDENTIFIED BY 'z0rglub';GRANT ALL ON tw_testdb.* TO 'tw_testuser'@'localhost'; FLUSH PRIVILEGES;DB_* envs in phpunit.xml to a containerized MySQL instance.tests/Unit, for example tests/Unit/PhpUnitSmokeTest.php<?php
declare(strict_types=1);
use PHPUnit\Framework\TestCase;
final class PhpUnitSmokeTest extends TestCase
{
public function test_truth(): void
{
$this->assertTrue(true);
}
}
vendor/bin/phpunit tests/Unit/PhpUnitSmokeTest.phptests/Unit, for example tests/Unit/PestSmokeTest.php<?php
it('asserts that true is true', function () {
expect(true)->toBeTrue();
});
test('truth', function () {
$this->assertTrue(true);
});
vendor/bin/pest tests/Unit/PestSmokeTest.phpWhen testing components that interact with external services or configuration, use Laravel's built-in mocking:
HTTP Fakes:
use Illuminate\Support\Facades\Http;
Http::fake([
'api.example.com/*' => Http::response(['data' => 'mocked'], 200),
]);
// Execute code...
Http::assertSent(fn ($request) => str_contains($request->url(), 'api.example.com'));
Config Overrides:
use Illuminate\Support\Facades\Config;
Config::set('services.scrapfly.key', 'test_key');
Tests\TestCaseWithDb and ensure the test DB is reachable.tests/TestCase.php with CreatesApplication if needed.