You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
975 B
42 lines
975 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
namespace Chamilo\Tests\CoreBundle\Controller;
|
|
|
|
use Chamilo\Tests\ChamiloTestTrait;
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
/**
|
|
* @covers \Chamilo\CoreBundle\Controller\IndexController
|
|
*/
|
|
class IndexControllerTest extends WebTestCase
|
|
{
|
|
use ChamiloTestTrait;
|
|
|
|
public function testIndex(): void
|
|
{
|
|
$client = static::createClient();
|
|
$client->request('GET', '/');
|
|
|
|
$this->assertResponseIsSuccessful();
|
|
}
|
|
|
|
public function testUserAccess(): void
|
|
{
|
|
$client = static::createClient();
|
|
|
|
// retrieve the admin
|
|
$admin = $this->getUser('admin');
|
|
|
|
// simulate $testUser being logged in
|
|
$client->loginUser($admin);
|
|
|
|
$client->request('GET', '/account/edit');
|
|
|
|
$this->assertSame(Response::HTTP_OK, $client->getResponse()->getStatusCode());
|
|
}
|
|
}
|
|
|