-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
Tirapong Chaiyakun edited this page Sep 19, 2026
·
1 revision
composer test
composer cs-fix
composer cs-checkPHPUnit อ่าน phpunit.xml แล้วรันทุกไฟล์ใน tests/
| ไฟล์ | ตรวจอะไร |
|---|---|
tests/Core/ModelFillTest.php |
fillable / guarded |
tests/Core/CipherKeyTest.php |
คีย์เข้ารหัสจาก env |
tests/Core/ValidatorTest.php |
กฎ validation |
tests/Core/PaginatorTest.php |
ตัดหน้าและ meta |
tests/Core/BlueprintTest.php |
คอลัมน์ PK FK index |
tests/Core/UploadTest.php |
เก็บไฟล์และกันนามสกุลอันตราย |
tests/Core/RateLimitPruneTest.php |
ลบไฟล์ rate ที่หมดอายุ |
tests/Core/LogPruneTest.php |
ลบไฟล์ล็อกที่หมดอายุ |
วางไฟล์ใน tests/Core/ แล้วสืบทอด PHPUnit\Framework\TestCase
<?php
declare(strict_types=1);
namespace Tests\Core;
use PHPUnit\Framework\TestCase;
final class ExampleTest extends TestCase
{
public function testTrue(): void
{
$this->assertTrue(true);
}
}ทุกไฟล์ PHP ใช้ PER Coding Style 3.0 ผ่าน PHP-CS-Fixer ชุด @PER-CS3x0
อย่าใช้ PSR-2 หรือ PHP Resolver / phpcs เป็นตัวชี้สไตล์