<?php

namespace App\Tests\Application\Access;

use App\Tests\Application\OtWebTestCase;

class AdminAccessTest extends OtWebTestCase
{
    public function testAdminAccessMethod(): void
    {
        $this->logger->info("\033[1;34mStarting test... get admin access ID\033[0m");
        $this->loginAs($this->user);
        $this->get('/api/admin-access/1');
        $this->assertResponseStatusCodeSame(200);
        $this->logger->info("\033[1;32mTest 'get admin access ID' succeeded\033[0m");

        $this->logger->info("\033[1;34mStarting test... put admin access ID\033[0m");
        $this->loginAs($this->user);
        $this->put('/api/admin-access/1', [
            'username' => 'tata',
        ]);
        $this->assertResponseStatusCodeSame(200);
        $this->logger->info("\033[1;32mTest 'put admin access ID' succeeded\033[0m");
    }
}
