Improved data fixtures with Faker (#234)

This commit is contained in:
Kevin Papst
2018-07-24 19:24:58 +02:00
committed by GitHub
parent 20a2d94996
commit 5ccc1c991b
12 changed files with 362 additions and 442 deletions

View File

@@ -9,7 +9,7 @@
namespace App\Tests\Controller;
use App\DataFixtures\AppFixtures;
use App\DataFixtures\UserFixtures;
/**
* @coversDefaultClass \App\Controller\InvoiceController
@@ -19,20 +19,20 @@ class ProfileControllerTest extends ControllerBaseTest
{
public function testIsSecure()
{
$this->assertUrlIsSecured('/profile/' . AppFixtures::USERNAME_USER);
$this->assertUrlIsSecured('/profile/' . UserFixtures::USERNAME_USER);
}
public function testIndexAction()
{
$client = $this->getClientForAuthenticatedUser();
$this->request($client, '/profile/' . AppFixtures::USERNAME_USER);
$this->request($client, '/profile/' . UserFixtures::USERNAME_USER);
$this->assertTrue($client->getResponse()->isSuccessful());
}
public function testIndexActionWithDifferentUsername()
{
$client = $this->getClientForAuthenticatedUser();
$this->request($client, '/profile/' . AppFixtures::USERNAME_TEAMLEAD);
$this->request($client, '/profile/' . UserFixtures::USERNAME_TEAMLEAD);
$this->assertFalse($client->getResponse()->isSuccessful());
}
}