35 lines
980 B
PHP
35 lines
980 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace Tests\Unit\Osint;
|
||
|
|
|
||
|
|
use App\Osint\RunnerRegistry;
|
||
|
|
use Tests\TestCase;
|
||
|
|
|
||
|
|
class RunnerRegistryTest extends TestCase
|
||
|
|
{
|
||
|
|
public function test_opencorporates_is_hidden_without_a_configured_token(): void
|
||
|
|
{
|
||
|
|
config(['services.opencorporates.token' => null]);
|
||
|
|
|
||
|
|
$this->assertFalse((new RunnerRegistry)->has('opencorporates'));
|
||
|
|
}
|
||
|
|
|
||
|
|
public function test_opencorporates_is_available_once_a_token_is_configured(): void
|
||
|
|
{
|
||
|
|
config(['services.opencorporates.token' => 'test-token']);
|
||
|
|
|
||
|
|
$this->assertTrue((new RunnerRegistry)->has('opencorporates'));
|
||
|
|
}
|
||
|
|
|
||
|
|
public function test_unconditional_runners_are_always_available(): void
|
||
|
|
{
|
||
|
|
$this->assertTrue((new RunnerRegistry)->has('sherlock'));
|
||
|
|
$this->assertTrue((new RunnerRegistry)->has('dns'));
|
||
|
|
}
|
||
|
|
|
||
|
|
public function test_unknown_source_key_is_never_available(): void
|
||
|
|
{
|
||
|
|
$this->assertFalse((new RunnerRegistry)->has('not-a-real-source'));
|
||
|
|
}
|
||
|
|
}
|