2024-02-02 20:56:25 +00:00
|
|
|
<?php
|
|
|
|
|
2024-02-19 00:30:12 +00:00
|
|
|
namespace Tests\Wallabag\SiteConfig;
|
2024-02-02 20:56:25 +00:00
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2024-02-19 00:30:12 +00:00
|
|
|
use Wallabag\SiteConfig\ArraySiteConfigBuilder;
|
|
|
|
use Wallabag\SiteConfig\SiteConfig;
|
2024-02-02 20:56:25 +00:00
|
|
|
|
|
|
|
class ArraySiteConfigBuilderTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testItReturnsSiteConfigThatExists()
|
|
|
|
{
|
|
|
|
$builder = new ArraySiteConfigBuilder(['example.com' => []]);
|
|
|
|
$res = $builder->buildForHost('www.example.com');
|
|
|
|
|
|
|
|
$this->assertInstanceOf(SiteConfig::class, $res);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testItReturnsFalseOnAHostThatDoesNotExist()
|
|
|
|
{
|
|
|
|
$builder = new ArraySiteConfigBuilder(['anotherexample.com' => []]);
|
|
|
|
$res = $builder->buildForHost('example.com');
|
|
|
|
|
|
|
|
$this->assertfalse($res);
|
|
|
|
}
|
|
|
|
}
|