Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Jul 27, 2024
1 parent 944ed44 commit 1acecda
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions tests/Service/User/RegisterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

namespace Fusio\Impl\Tests\Service\User;

use Doctrine\DBAL\Connection;
use Fusio\Impl\Service;
use Fusio\Impl\Service\System\ContextFactory;
use Fusio\Impl\Service\User\Register;
Expand Down Expand Up @@ -61,10 +60,7 @@ public function testRegister()
$register->register($user, $context);

// check user
/** @var Connection $connection */
$connection = Environment::getService(Connection::class);

$user = $connection->fetchAssociative('SELECT * FROM fusio_user WHERE id = :id', ['id' => 6]);
$user = $this->connection->fetchAssociative('SELECT * FROM fusio_user WHERE id = :id', ['id' => 6]);

$this->assertEquals(6, $user['id']);
$this->assertEquals(null, $user['identity_id']);
Expand Down Expand Up @@ -95,10 +91,7 @@ public function testRegisterNoApproval()
$register->register($user, $context);

// check user
/** @var Connection $connection */
$connection = Environment::getService(Connection::class);

$user = $connection->fetchAssociative('SELECT * FROM fusio_user WHERE id = :id', ['id' => 6]);
$user = $this->connection->fetchAssociative('SELECT * FROM fusio_user WHERE id = :id', ['id' => 6]);

$this->assertEquals(6, $user['id']);
$this->assertEquals(null, $user['identity_id']);
Expand Down Expand Up @@ -129,10 +122,7 @@ public function testRegisterNoCaptchaSecret()
$register->register($user, $context);

// check user
/** @var Connection $connection */
$connection = Environment::getService(Connection::class);

$user = $connection->fetchAssociative('SELECT * FROM fusio_user WHERE id = :id', ['id' => 6]);
$user = $this->connection->fetchAssociative('SELECT * FROM fusio_user WHERE id = :id', ['id' => 6]);

$this->assertEquals(6, $user['id']);
$this->assertEquals(null, $user['identity_id']);
Expand Down Expand Up @@ -221,10 +211,6 @@ private function newMailer(bool $send): Service\User\Mailer

private function getConfigId(string $name): int
{
/** @var Connection $connection */
$connection = Environment::getService(Connection::class);
$configId = $connection->fetchOne('SELECT id FROM fusio_config WHERE name = :name', ['name' => $name]);

return $configId;
return $this->connection->fetchOne('SELECT id FROM fusio_config WHERE name = :name', ['name' => $name]);
}
}

0 comments on commit 1acecda

Please sign in to comment.