Completed
Pull Request — master (#14)
by Amine
01:22
created

HelloWorldTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A test_it_prints_hello_world() 0 7 1
A test_it_uses_formal_greeting() 0 7 1
A test_it_shows_hello_world_version() 0 5 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