{
  "skill_name": "laravel-testing",
  "evals": [
    {
      "id": 1,
      "prompt": "Write a Pest feature test in Laravel",
      "expected_output": "uses(RefreshDatabase::class); it('creates a post', function() { $response = $this->postJson('/api/posts', ['title' => 'Test']); $response->assertStatus(201)->assertJson(['data' => ['title' => 'Test']]); });",
      "assertions": [
        { "type": "contains", "value": "uses(RefreshDatabase::class)" },
        { "type": "contains", "value": "it('creates a post'" },
        { "type": "contains", "value": "postJson('/api/posts'" },
        { "type": "contains", "value": "assertStatus(201)" }
      ]
    },
    {
      "id": 2,
      "prompt": "Use RefreshDatabase in Laravel tests",
      "expected_output": "Add uses(RefreshDatabase::class) in Pest or use RefreshDatabase trait in PHPUnit TestCase; database rolled back between each test; use DatabaseTransactions for faster but non-truncating isolation",
      "assertions": [
        { "type": "contains", "value": "RefreshDatabase::class" },
        { "type": "contains", "value": "database rolled back" },
        { "type": "contains", "value": "DatabaseTransactions" }
      ]
    },
    {
      "id": 3,
      "prompt": "Create Eloquent Factories for test data in Laravel",
      "expected_output": "php artisan make:factory PostFactory --model=Post; define definition(): array with fake() data; use Post::factory()->count(3)->create(['user_id' => $user->id]) in tests; never DB::table()->insert()",
      "assertions": [
        { "type": "contains", "value": "make:factory PostFactory" },
        { "type": "contains", "value": "definition(): array" },
        { "type": "contains", "value": "Post::factory()" },
        { "type": "contains", "value": "never DB::table()->insert()" }
      ]
    },
    {
      "id": 4,
      "prompt": "Mock external services in Laravel tests",
      "expected_output": "$this->mock(PaymentService::class)->shouldReceive('charge')->once()->with(100)->andReturn(true); or use $this->spy() for loose verification; never make real network calls in tests",
      "assertions": [
        { "type": "contains", "value": "$this->mock(PaymentService::class)" },
        { "type": "contains", "value": "shouldReceive('charge')" },
        { "type": "contains", "value": "once()->with(100)" },
        { "type": "contains", "value": "never make real network calls" }
      ]
    },
    {
      "id": 5,
      "prompt": "Assert HTTP responses in Laravel feature tests",
      "expected_output": "$response->assertStatus(201)->assertJson(['data' => ['title' => 'Test']])->assertJsonStructure(['data' => ['id', 'title', 'created_at']])->assertHeader('Content-Type', 'application/json')",
      "assertions": [
        { "type": "contains", "value": "assertStatus(201)" },
        { "type": "contains", "value": "assertJson(['data'" },
        { "type": "contains", "value": "assertJsonStructure" },
        { "type": "contains", "value": "assertHeader" }
      ]
    },
    {
      "id": 6,
      "prompt": "Set up in-memory SQLite for Laravel unit tests",
      "expected_output": "Set <env name='DB_CONNECTION' value='sqlite'/> and <env name='DB_DATABASE' value=':memory:'/> in phpunit.xml; fast but SQLite lacks some MySQL features; use for unit tests, real DB for feature tests",
      "assertions": [
        { "type": "contains", "value": "DB_CONNECTION' value='sqlite" },
        { "type": "contains", "value": "DB_DATABASE' value=':memory" },
        { "type": "contains", "value": "phpunit.xml" }
      ]
    }
  ],
  "should_not_trigger": [
    "Write Jest tests for a React component",
    "PHPUnit tests for a Symfony application",
    "Testing in NestJS with supertest",
    "Go table-driven tests with testify"
  ]
}
