HelloWorldTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test_it_prints_hello_world() 0 6 1
A test_it_shows_hello_world_version() 0 4 1
A test_it_uses_formal_greeting() 0 6 1
1
<?php namespace Tarsana\Command\Examples\Tests;
2
3
use Tarsana\Command\Examples\HelloWorld;
4
use Tarsana\Tester\CommandTestCase;
5
6
7
class HelloWorldTest extends CommandTestCase {
8
9
    public function test_it_prints_hello_world()
10
    {
11
        $this->withStdin("Amine\n")
12
             ->command(new HelloWorld)
13
             ->prints("Your name:")
14
             ->prints("Hello Amine<br>");
15
    }
16
    
17
    public function test_it_uses_formal_greeting()
18
    {
19
        $this->withStdin("Amine\n")
20
             ->command(new HelloWorld, ['--formal'])
21
             ->prints("Your name:")
22
             ->prints("Greetings Amine<br>");
23
    }
24
25
    public function test_it_shows_hello_world_version()
26
    {
27
        $this->command(new HelloWorld, ['--version'])
28
             ->printsExactly("<info>Hello World</info> version <info>1.0.0-alpha</info><br>");
29
    }
30
31
}
32