diff --git a/app/src/Authorize/AccessConditions.php b/app/src/Authorize/AccessConditions.php index 1746b44..b2ee98d 100644 --- a/app/src/Authorize/AccessConditions.php +++ b/app/src/Authorize/AccessConditions.php @@ -25,9 +25,11 @@ */ class AccessConditions implements AccessConditionsInterface { + protected UserInterface $user; + public function __construct( protected Config $config, - protected ?UserInterface $user = null, + ?UserInterface $user = null, ) { $this->user = $user ?? new User(); } diff --git a/app/tests/Bakery/CreateAdminUserTest.php b/app/tests/Bakery/CreateAdminUserTest.php index 4b8c9d7..1010315 100644 --- a/app/tests/Bakery/CreateAdminUserTest.php +++ b/app/tests/Bakery/CreateAdminUserTest.php @@ -144,16 +144,7 @@ public function testForFailedDbConnection(): void $connection = Mockery::mock(Connection::class) ->shouldReceive('getPdo')->once()->andThrow(new PDOException()) ->getMock(); - - $manager = Mockery::mock(DatabaseManager::class) - ->shouldReceive('getDefaultConnection')->once()->andReturn('test') - ->getMock(); - - $db = Mockery::mock(Capsule::class) - ->shouldReceive('getDatabaseManager')->once()->andReturn($manager) - ->shouldReceive('getConnection')->once()->andReturn($connection) - ->getMock(); - $this->ci->set(Capsule::class, $db); + $this->ci->set(Connection::class, $connection); /** @var CreateAdminUser */ $command = $this->ci->get(CreateAdminUser::class);