Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Jan 11, 2021
1 parent 0aeb99f commit d5b273f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion packages/admin/src/PushwordAdminBundle.php
Expand Up @@ -2,7 +2,6 @@

namespace Pushword\Admin;

use Pushword\Admin\DependencyInjection\AdminExtension;
use Symfony\Component\HttpKernel\Bundle\Bundle;

class PushwordAdminBundle extends Bundle
Expand Down
16 changes: 8 additions & 8 deletions packages/admin/tests/AbstractAdminTest.php
Expand Up @@ -12,25 +12,25 @@ abstract class AbstractAdminTest extends WebTestCase
{
protected static bool $userCreated = false;

protected static $client;
protected $client;

protected function loginUser(): KernelBrowser
{
if (self::$client) {
return self::$client;
if (null !== $this->client) {
return $this->client;
}

self::$client = static::createClient();
$this->client = static::createClient();

self::createUser();

$crawler = self::$client->request('GET', '/login');
$crawler = $this->client->request('GET', '/login');
$form = $crawler->filter('[method=post]')->form();
$form['email'] = 'admin@example.tld';
$form['password'] = 'mySecr3tpAssword';
$crawler = self::$client->submit($form);
$crawler = $this->client->submit($form);

return self::$client;
return $this->client;
}

protected static function createUser(): void
Expand All @@ -40,7 +40,7 @@ protected static function createUser(): void
}

$userRepository = static::$container->get(UserRepository::class);
$testUser = $userRepository->findOneByEmail('jane.doe@example.com');
$testUser = $userRepository->findOneByEmail('admin@example.tld');

if ($testUser) {
return;
Expand Down
1 change: 0 additions & 1 deletion packages/admin/tests/AdminTest.php
Expand Up @@ -31,7 +31,6 @@ public function testAdmins()
}
}


$client->request('GET', '/admin/app/page/2/edit');
$this->assertResponseIsSuccessful();
}
Expand Down
Expand Up @@ -6,7 +6,7 @@

class ConversationAdminTest extends AbstractAdminTest
{
public function testAdmins()
public function testAdmin()
{
$client = $this->loginUser();

Expand Down

0 comments on commit d5b273f

Please sign in to comment.