-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResolverTest.php
More file actions
86 lines (74 loc) · 1.99 KB
/
ResolverTest.php
File metadata and controls
86 lines (74 loc) · 1.99 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
<?php
declare(strict_types=1);
/**
* Fast Forward Development Tools for PHP projects.
*
* This file is part of fast-forward/dev-tools project.
*
* @author Felipe Sayão Lobato Abreu <github@mentordosnerds.com>
* @license https://opensource.org/licenses/MIT MIT License
*
* @see https://github.com/php-fast-forward/
* @see https://github.com/php-fast-forward/dev-tools
* @see https://github.com/php-fast-forward/dev-tools/issues
* @see https://php-fast-forward.github.io/dev-tools/
* @see https://datatracker.ietf.org/doc/html/rfc2119
*/
namespace FastForward\DevTools\Tests\License;
use FastForward\DevTools\License\Resolver;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
#[CoversClass(Resolver::class)]
final class ResolverTest extends TestCase
{
private Resolver $resolver;
/**
* @return void
*/
protected function setUp(): void
{
parent::setUp();
$this->resolver = new Resolver();
}
/**
* @return void
*/
#[Test]
public function resolveWithMITWillReturnTemplateFilename(): void
{
self::assertSame('mit.txt', $this->resolver->resolve('MIT'));
}
/**
* @return void
*/
#[Test]
public function resolveWithApache2WillReturnApache20Template(): void
{
self::assertSame('apache-2.0.txt', $this->resolver->resolve('Apache-2'));
}
/**
* @return void
*/
#[Test]
public function resolveWithUnknownLicenseWillReturnNull(): void
{
self::assertNull($this->resolver->resolve('Unknown-License'));
}
/**
* @return void
*/
#[Test]
public function resolveWithMissingLicenseWillReturnNull(): void
{
self::assertNull($this->resolver->resolve(null));
}
/**
* @return void
*/
#[Test]
public function resolveWithEmptyLicenseWillReturnNull(): void
{
self::assertNull($this->resolver->resolve(' '));
}
}