Files
alrahma_sunday_school_api/tests/Unit/Services/Phone/PhoneFormatterServiceTest.php
T
2026-03-11 17:53:15 -04:00

27 lines
628 B
PHP

<?php
namespace Tests\Unit\Services\Phone;
use App\Services\Phone\PhoneFormatterService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class PhoneFormatterServiceTest extends TestCase
{
use RefreshDatabase;
public function test_format_returns_null_for_invalid(): void
{
$service = app(PhoneFormatterService::class);
$this->assertNull($service->format('123'));
}
public function test_format_formats_digits(): void
{
$service = app(PhoneFormatterService::class);
$this->assertSame('555-123-4567', $service->format('(555) 123-4567'));
}
}