mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-16 18:01:38 +00:00
Move test files directly under tests/ directory
This commit is contained in:
parent
a37b385c23
commit
24da70e338
117 changed files with 4 additions and 4 deletions
44
tests/SiteConfig/SiteConfigTest.php
Normal file
44
tests/SiteConfig/SiteConfigTest.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Wallabag\CoreBundle\SiteConfig;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Wallabag\CoreBundle\SiteConfig\SiteConfig;
|
||||
|
||||
class SiteConfigTest extends TestCase
|
||||
{
|
||||
public function testInitSiteConfig()
|
||||
{
|
||||
$config = new SiteConfig([]);
|
||||
|
||||
$this->assertInstanceOf(SiteConfig::class, $config);
|
||||
}
|
||||
|
||||
public function testUnknownProperty()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unknown property: "bad"');
|
||||
|
||||
new SiteConfig(['bad' => true]);
|
||||
}
|
||||
|
||||
public function testInitSiteConfigWillFullOptions()
|
||||
{
|
||||
$config = new SiteConfig([
|
||||
'host' => 'example.com',
|
||||
'requiresLogin' => true,
|
||||
'notLoggedInXpath' => '//all',
|
||||
'loginUri' => 'https://example.com/login',
|
||||
'usernameField' => 'username',
|
||||
'passwordField' => 'password',
|
||||
'extraFields' => [
|
||||
'action' => 'login',
|
||||
'foo' => 'bar',
|
||||
],
|
||||
'username' => 'johndoe',
|
||||
'password' => 'unkn0wn',
|
||||
]);
|
||||
|
||||
$this->assertInstanceOf(SiteConfig::class, $config);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue