<?php

// ReadHome

declare(strict_types=1);

namespace {{ tree.getFullNameSpaceOfFile(file, entity, action) }};

class {{ helper.getClassName(file, entity, action) }} extends {{ helper.getClassName(helper.findFile('AbstractItemTestBase'), entity, action) }}
{
    protected static function getPath(): string
    {
        return "{{ entity.name }}/{{ action }}";
    }

    public function test{{ action + entity.name }}()
    {
        $User = $this->createUser();
        $Item = $this->makeItem($User);
        $Item->save();

        $Response = $this->getJson($this->makeUri())
            ->assertStatus(401);

        $this->actingAs($User);

        $Response = $this->getJson($this->makeUri())
            ->assertStatus(200);
        $this->seeData($Response);
    }
}
