<?php declare(strict_types=1);

namespace Apexl\Io\User\Tests\FeatureTests;

use Apexl\Io\TestInfrastructure\FeatureTest;
use Apexl\Io\User\TestInfrastructure\MakesAuthenticatedRequests;

final class AuthenticationTest extends FeatureTest
{
    use MakesAuthenticatedRequests;

    public function testNotAuthenticated(): void
    {
        $data = $this->get('/authenticated');
        $this->assertArrayHasKey('authenticated', $data);
        $this->assertFalse($data['authenticated']);
    }

    public function testAuthenticated(): void
    {
        $data = $this->getAuthenticated('/authenticated');
        $this->assertArrayHasKey('authenticated', $data);
        $this->assertTrue($data['authenticated']);
    }
}
