<?php

namespace App\Tests\Service\System;

use App\Service\System\DatabaseDumper;
use PHPUnit\Framework\TestCase;

class DatabaseDumperTest extends TestCase
{
    public function testDumpSuccess(): void
    {
        $dumper = new class extends DatabaseDumper {
            public string $lastCommand = '';
            
            protected function execute(string $command, &$output, &$returnCode): void
            {
                $this->lastCommand = $command;
                $returnCode = 0;
            }
        };

        $dumper->dump('postgresql://user:pass@localhost:5432/db', 'dump.sql');
        
        $this->assertStringContainsString('pg_dump', $dumper->lastCommand);
    }
}
