-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWizardCLITest.php
More file actions
39 lines (35 loc) · 1.12 KB
/
WizardCLITest.php
File metadata and controls
39 lines (35 loc) · 1.12 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
<?php
use PHPUnit\Framework\TestCase;
use WizardCLI\WizardCLI;
final class WizardCLITest extends TestCase
{
public function testColorOutput()
{
$cli = new WizardCLI(['theme' => 'wizard']);
$str = $cli->colors->color("Test", "magenta+bold");
$this->assertStringContainsString("\033", $str);
}
public function testTableOutput()
{
$cli = new WizardCLI(['theme' => 'gold']);
$output = $cli->table->render(["A", "B"], [["1", "2"], ["3", "4"]]);
$this->assertStringContainsString("| A", $output);
$this->assertStringContainsString("| 1", $output);
}
public function testAsciiArt()
{
$cli = new WizardCLI(['theme' => 'wizard']);
$art = $cli->art->render("MAGIC");
$this->assertStringContainsString("MAGIC", $art);
}
public function testProgressBar()
{
$cli = new WizardCLI(['theme' => 'dark']);
ob_start();
$cli->progressBar(10, "Load");
$cli->progressAdvance(10);
$cli->progressFinish();
$output = ob_get_clean();
$this->assertStringContainsString("%", $output);
}
}