- Add tests/Pest.php with TestCase binding and RefreshDatabase - Add example feature tests: WelcomePageTest, HealthEndpointTest - Add composer scripts: lint, test, test:coverage Implements P2-049, P2-050, P2-051 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
40 lines
983 B
PHP
40 lines
983 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Example Unit Tests
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Unit tests verify isolated functionality without database or HTTP
|
|
| requests. This file demonstrates the Pest testing syntax used in
|
|
| Core PHP Framework applications.
|
|
|
|
|
| Delete this file and add your own unit tests as needed.
|
|
|
|
|
*/
|
|
|
|
it('demonstrates basic expectations', function () {
|
|
expect(true)->toBeTrue();
|
|
expect(1 + 1)->toBe(2);
|
|
});
|
|
|
|
it('demonstrates string expectations', function () {
|
|
$greeting = 'Hello, World!';
|
|
|
|
expect($greeting)
|
|
->toBeString()
|
|
->toContain('Hello')
|
|
->toStartWith('Hello')
|
|
->toEndWith('!');
|
|
});
|
|
|
|
it('demonstrates array expectations', function () {
|
|
$items = ['apple', 'banana', 'cherry'];
|
|
|
|
expect($items)
|
|
->toBeArray()
|
|
->toHaveCount(3)
|
|
->toContain('banana');
|
|
});
|