Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antedebaas committed Nov 18, 2024
1 parent b8397f8 commit 443a808
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/Command/UpdateDatabaseCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,28 @@ public function testInvalidDatabasePath(): void
$command->run($this->input, $this->output);
}

public function testDownloadWithoutLicense(): void
{
$this->input
->expects($this->at(4))
->method('getArgument')
->with('databases')
->willReturn(['default']);

$databases = ['default' => [
'url' => 'https://example.com/GeoIP2.tar.gz',
'path' => '/tmp/GeoIP2.mmdb',
]];

$this->downloader
->expects($this->never())
->method('download')
->with($databases['default']['url'], $databases['default']['path']);

$command = new UpdateDatabaseCommand($this->downloader, $databases);
$command->run($this->input, $this->output);
}

public function testDownloadOneDatabases(): void
{
$this->input
Expand All @@ -201,6 +223,7 @@ public function testDownloadOneDatabases(): void
$databases = ['default' => [
'url' => 'https://example.com/GeoIP2.tar.gz',
'path' => '/tmp/GeoIP2.mmdb',
'license' => 'license',
]];

$this->downloader
Expand All @@ -224,10 +247,12 @@ public function testDownloadSeveralDatabases(): void
'first' => [
'url' => 'https://example.com/GeoIP2-First.tar.gz',
'path' => '/tmp/GeoIP2-First.mmdb',
'license' => 'license',
],
'second' => [
'url' => 'https://example.com/GeoIP2-Second.tar.gz',
'path' => '/tmp/GeoIP2-Second.mmdb',
'license' => 'license',
],
];

Expand Down

0 comments on commit 443a808

Please sign in to comment.