ReceiverTest::testRun()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 20
rs 9.4285
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
namespace ADiaz\AML\OpenList\commands;
4
5
use Symfony\Component\Console\Application;
6
use Symfony\Component\Console\Tester\CommandTester;
7
8
/**
9
 * This file is part of the OpenList Parser utility.
10
 *
11
 *
12
 * @category  PHP
13
 *
14
 * @author    Alberto Diaz <[email protected]>
15
 * @copyright 2016 Alberto Diaz <[email protected]>
16
 * @license   This source file is subject to the MIT license that is bundled
17
 *
18
 * @version   Release: @package_version@
19
 *
20
 * @link      http://tytem.com
21
 */
22
class ReceiverTest extends \PHPUnit_Framework_TestCase
23
{
24
    protected $project_path;
25
    protected $list_path;
26
27
    protected function setUp()
28
    {
29
        $this->list_path = __DIR__.'/../../../lists/';
30
31
        if (!file_exists($this->list_path)) {
32
            mkdir($this->list_path, 0777, true);
33
        }
34
    }
35
36
    /**
37
     * Execute.
38
     */
39
    public function testRun()
40
    {
41
        $config = require __DIR__.'/../../../src/OpenList/conf/app.php';
42
43
        $application = new Application();
44
        $application->add(new Receiver($config));
45
        //$application->run();
0 ignored issues
show
Unused Code Comprehensibility introduced by
84% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
46
47
        $command = $application->find('receive');
48
        $commandTester = new CommandTester($command);
49
        $commandTester->execute(array(
50
            'command' => $command->getName(),
51
        ));
52
53
        $this->assertRegExp('/'.Receiver::FINISH_OK.'/', $commandTester->getDisplay());
54
55
        $this->assertFileExists($this->list_path.'ukhmt/ukhmt.csv');
56
        $this->assertFileExists($this->list_path.'usofac/usofac.xml');
57
        $this->assertFileExists($this->list_path.'unsc/unsc.xml');
58
    }
59
}
60