-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSettingsTest.php
More file actions
97 lines (82 loc) · 2.48 KB
/
SettingsTest.php
File metadata and controls
97 lines (82 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
declare(strict_types=1);
namespace SkillDisplay\PHPToolKit\Tests\Unit\Configuration;
use SkillDisplay\PHPToolKit\Configuration\Settings;
use PHPUnit\Framework\TestCase;
/**
* @covers SkillDisplay\PHPToolKit\Configuration\Settings
*/
class SettingsTest extends TestCase
{
/**
* @test
*/
public function canBeCreatedWithoutAnyValues()
{
$subject = new Settings('none');
static::assertInstanceOf(
Settings::class,
$subject
);
}
/**
* @test
*/
public function returnsExpectedValuesWhenCreatedWithoutAnyValues()
{
$subject = new Settings('none');
static::assertSame('none', $subject->getApiKey());
static::assertSame(0, $subject->getVerifierID());
static::assertSame('', $subject->getUserSecret());
static::assertSame('https://www.skilldisplay.eu', $subject->getAPIUrl());
static::assertSame('https://my.skilldisplay.eu', $subject->getMySkillDisplayUrl());
}
/**
* @test
*/
public function canBeCreatedWithApiKey()
{
$subject = new Settings('---YOUR-API-KEY---');
static::assertInstanceOf(
Settings::class,
$subject
);
}
/**
* @test
*/
public function returnsExpectedValuesWhenCreatedWithApiKey()
{
$subject = new Settings('---YOUR-API-KEY---');
static::assertSame('---YOUR-API-KEY---', $subject->getApiKey());
static::assertSame(0, $subject->getVerifierID());
static::assertSame('', $subject->getUserSecret());
static::assertSame('https://www.skilldisplay.eu', $subject->getAPIUrl());
static::assertSame('https://my.skilldisplay.eu', $subject->getMySkillDisplayUrl());
}
/**
* @test
*/
public function returnsVerifierIdWhenProvided()
{
$subject = new Settings('none', 10);
static::assertSame(10, $subject->getVerifierID());
}
/**
* @test
*/
public function returnsUserSecretWhenProvided()
{
$subject = new Settings('none', 0, '---USER-SECRET---');
static::assertSame('---USER-SECRET---', $subject->getUserSecret());
}
/**
* @test
*/
public function returnsUrlsWithProvidedDomain()
{
$subject = new Settings('none', 0, '', 'example.com');
static::assertSame('https://example.com', $subject->getAPIUrl());
static::assertSame('https://my.example.com', $subject->getMySkillDisplayUrl());
}
}