Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Unit testing, test structure, mocking.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -29% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -16% | 0% |
| case-04 | ✗→✓ | ▲ Improved | -31% | 0% |
| case-05 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 28% | 0% |
php<?php namespace Tests\Unit; use CodeIgniter\Test\CIUnitTestCase; class UserServiceTest extends CIUnitTestCase { protected $service; protected function setUp(): void { parent::setUp(); $this->service = new UserService(); } public function testCreateUserWithValidData() { $data = ['name' => 'John', 'email' => 'john@example.com']; $user = $this->service->createUser($data); $this->assertInstanceOf(User::class, $user); $this->assertEquals('John', $user->name); } public function testCreateUserThrowsExceptionWithInvalidEmail() { $this->expectException(ValidationException::class); $this->service->createUser(['email' => 'invalid']); } }
bashvendor/bin/phpunit
Other measured skills in the registry, with their headline benchmark lift.