Completed
Pull Request — master (#4)
by Timo
13:31 queued 05:30
created

GenerateInterfaceContext::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 3
rs 10
c 1
b 0
f 1
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace features\Context\CodeGeneration;
4
5
use features\Behavior\Context\CodeGeneration\InterfaceContextTrait;
6
use features\Behavior\Console\ApplicationTestTrait;
7
8
use Behat\Behat\Context\Context;
9
10
/**
11
 * Defines application features from the specific context.
12
 */
13
class GenerateInterfaceContext implements Context
14
{
15
    use InterfaceContextTrait,
16
        ApplicationTestTrait;
17
18
    /**
19
     * Initializes context.
20
     */
21
    public function __construct()
22
    {
23
    }
24
25
    /**
26
     * @beforeScenario
27
     */
28
    public function setup()
29
    {
30
        $this->setupApplication();
31
    }
32
33
    /**
34
     * @Given I have started implementing the :interface interface
35
     * @Given I start implementing the :interface interface
36
     */
37
    public function iImplementTheInterface($interface)
38
    {
39
        $arguments = array(
40
            'command' => 'behavior:implement',
41
            'interface' => $interface
42
        );
43
        if ($this->applicationTester->run($arguments, []) !== 0) {
44
            throw new \Exception('Test runner exited with an error ');
45
        }
46
    }
47
}
48
49