mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 06:44:59 +00:00
Fix some tests
This commit is contained in:
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Tests\Controller;
|
||||
|
||||
use Chill\MainBundle\Test\PrepareClientTrait;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
/**
|
||||
@@ -22,9 +23,11 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
*/
|
||||
final class SearchControllerTest extends WebTestCase
|
||||
{
|
||||
use PrepareClientTrait;
|
||||
|
||||
public function testDomainUnknow()
|
||||
{
|
||||
$client = $this->getAuthenticatedClient();
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
$crawler = $client->request('GET', '/fr/search', ['q' => '@unknow domain']);
|
||||
|
||||
@@ -41,7 +44,7 @@ final class SearchControllerTest extends WebTestCase
|
||||
|
||||
public function testParsingIncorrect()
|
||||
{
|
||||
$client = $this->getAuthenticatedClient();
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
$crawler = $client->request(
|
||||
'GET',
|
||||
@@ -59,7 +62,7 @@ final class SearchControllerTest extends WebTestCase
|
||||
*/
|
||||
public function testSearchPath()
|
||||
{
|
||||
$client = $this->getAuthenticatedClient();
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
$crawler = $client->request('GET', '/fr/search', ['q' => 'default search']);
|
||||
|
||||
@@ -71,7 +74,7 @@ final class SearchControllerTest extends WebTestCase
|
||||
|
||||
public function testSearchPathEmpty()
|
||||
{
|
||||
$client = $this->getAuthenticatedClient();
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
$crawler = $client->request('GET', '/fr/search?q=');
|
||||
|
||||
@@ -80,7 +83,7 @@ final class SearchControllerTest extends WebTestCase
|
||||
|
||||
public function testUnknowName()
|
||||
{
|
||||
$client = $this->getAuthenticatedClient();
|
||||
$client = $this->getClientAuthenticated();
|
||||
|
||||
$client->request(
|
||||
'GET',
|
||||
@@ -90,12 +93,4 @@ final class SearchControllerTest extends WebTestCase
|
||||
|
||||
$this->assertTrue($client->getResponse()->isNotFound());
|
||||
}
|
||||
|
||||
private function getAuthenticatedClient()
|
||||
{
|
||||
return self::createClient([], [
|
||||
'PHP_AUTH_USER' => 'center b_social',
|
||||
'PHP_AUTH_PW' => 'password',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user