fix: DockerSecretsResolver - don't normalize absolute paths like /var/www/html/...
Some checks failed
Deploy Application / deploy (push) Has been cancelled

This commit is contained in:
2025-11-24 21:28:25 +01:00
parent 4eb7134853
commit 77abc65cd7
1327 changed files with 91915 additions and 9909 deletions

View File

@@ -0,0 +1,66 @@
<?php
declare(strict_types=1);
use App\Framework\Database\ConnectionInterface;
use App\Framework\Database\Seed\SeedRepository;
use App\Framework\Database\ValueObjects\SqlQuery;
use App\Framework\DateTime\SystemClock;
describe('SeedRepository', function () {
beforeEach(function () {
$this->connection = Mockery::mock(ConnectionInterface::class);
$this->clock = new SystemClock();
$this->repository = new SeedRepository($this->connection, $this->clock);
});
it('checks if seeder has run', function () {
$result = Mockery::mock();
$result->shouldReceive('fetch')
->once()
->andReturn(['count' => 1]);
$this->connection->shouldReceive('query')
->once()
->with(Mockery::on(function (SqlQuery $query) {
return str_contains($query->sql, 'SELECT COUNT(*)');
}))
->andReturn($result);
expect($this->repository->hasRun('TestSeeder'))->toBeTrue();
});
it('returns false when seeder has not run', function () {
$result = Mockery::mock();
$result->shouldReceive('fetch')
->once()
->andReturn(['count' => 0]);
$this->connection->shouldReceive('query')
->once()
->andReturn($result);
expect($this->repository->hasRun('TestSeeder'))->toBeFalse();
});
it('marks seeder as run', function () {
$this->connection->shouldReceive('execute')
->once()
->with(Mockery::on(function (SqlQuery $query) {
return str_contains($query->sql, 'INSERT INTO seeds');
}));
$this->repository->markAsRun('TestSeeder', 'Test description');
});
it('clears all seeds', function () {
$this->connection->shouldReceive('execute')
->once()
->with(Mockery::on(function (SqlQuery $query) {
return str_contains($query->sql, 'DELETE FROM seeds');
}));
$this->repository->clearAll();
});
});