-
Notifications
You must be signed in to change notification settings - Fork 0
/
generateReadmeTest.php
63 lines (50 loc) · 1.5 KB
/
generateReadmeTest.php
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
<?php
namespace Ambimax;
use PHPUnit\Framework\TestCase;
class generateReadmeTest extends TestCase
{
private $gen;
private $defaultPhpVersion = '7.4';
public function setUp(): void
{
$this->gen = new generateReadme();
}
public function testRendering()
{
$this->assertStringContainsString(
'Hello World',
$this->gen->renderTemplate()
);
}
public function testGetModules()
{
$phpVersion = $this->defaultPhpVersion;
print_r($this->gen->getModules($phpVersion));
$this->assertContains('Zend OPcache', $this->gen->getModules($phpVersion));
$this->assertContains('bcmath', $this->gen->getModules($phpVersion));
$this->assertNotContains('', $this->gen->getModules($phpVersion));
$this->assertNotContains('[Zend Modules]', $this->gen->getModules($phpVersion));
}
public function testIsTrue()
{
$this->assertTrue(true);
}
public function testBuildMatrixTable()
{
$matrix = [
'7.3' => ['rot' => '1', 'blau' => '1'],
'7.4' => ['gelb' => '1', 'blau' => '1'],
'8.0' => ['grün' => '1'],
];
$result = $this->gen->buildMatrixTable($matrix);
$this->assertSame('| PHP Module | 7.3 | 7.4 | 8.0 |
|------------|-----|-----|-----|
| blau | ✓ | ✓ | |
| gelb | | ✓ | |
| grün | | | ✓ |
| rot | ✓ | | |
',
$result
);
}
}