Completed
Pull Request — master (#16)
by Nikola
01:29
created

DebugAspectCommandTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 7
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/**
3
 * Go! AOP framework
4
 *
5
 * @copyright Copyright 2015, Lisachenko Alexander <[email protected]>
6
 *
7
 * This source file is subject to the license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Go\Symfony\GoAopBundle\Tests\Command;
12
13
use PHPUnit\Framework\TestCase;
14
use Symfony\Component\Process\Process;
15
16
/**
17
 * Class DebugAspectCommandTest
18
 */
19
class DebugAspectCommandTest extends TestCase
20
{
21 View Code Duplication
    public function setUp()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
    {
23
        $process = new Process(sprintf('php %s cache:warmup:aop', realpath(__DIR__.'/../Fixtures/project/bin/console')));
24
        $process->run();
25
26
        $this->assertTrue($process->isSuccessful(), 'Unable to execute "cache:warmup:aop" command.');
27
    }
28
29
    /**
30
     * @test
31
     * @runInSeparateProcess
32
     */
33 View Code Duplication
    public function itDisplaysAspectsDebugInfo()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
34
    {
35
        $process = new Process(sprintf('php %s debug:aspect', realpath(__DIR__.'/../Fixtures/project/bin/console')));
36
        $process->run();
37
38
        $this->assertTrue($process->isSuccessful(), 'Unable to execute "debug:aspect" command.');
39
40
        $output = $process->getOutput();
41
42
        $expected = [
43
            'Go\Symfony\GoAopBundle\Kernel\AspectSymfonyKernel has following enabled aspects',
44
            'Go\Symfony\GoAopBundle\Tests\TestProject\Aspect\LoggingAspect',
45
            'Go\Symfony\GoAopBundle\Tests\TestProject\Aspect\LoggingAspect->beforeMethod'
46
        ];
47
48
        foreach ($expected as $string) {
49
            $this->assertContains($string, $output);
50
        }
51
    }
52
}
53