mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-15 21:41:06 +00:00
26 lines
714 B
PHP
26 lines
714 B
PHP
<?php
|
|
|
|
namespace Tests\Wallabag\SiteConfig;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Wallabag\SiteConfig\ArraySiteConfigBuilder;
|
|
use Wallabag\SiteConfig\SiteConfig;
|
|
|
|
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);
|
|
}
|
|
}
|