ConfigCommandTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A configCommand() 0 19 2
1
<?php
2
/**
3
 * VersionControl_HG
4
 * Simple OO implementation for Mercurial.
5
 *
6
 * PHP Version 5.4
7
 *
8
 * @copyright 2014 Siad Ardroumli
9
 * @license http://www.opensource.org/licenses/mit-license.php MIT
10
 * @link http://siad007.github.io/versioncontrol_hg
11
 */
12
13
namespace Siad007\VersionControl\HG\Tests\Command;
14
15
use Siad007\VersionControl\HG\Factory;
16
17
class ConfigCommandTest extends \PHPUnit_Framework_TestCase
18
{
19
    /**
20
     * @test
21
     */
22
    public function configCommand()
23
    {
24
        $configCmd = Factory::createConfig()
25
            ->addName('test')
26
            ->setUntrusted(true)
27
            ->setEdit(true)
28
            ->setLocal(true)
29
            ->setGlobal(true);
30
31
        $name = '\'test\'';
32
        $expected = 'hg config --untrusted --edit --local --global ';
33
34
        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
35
            $name = str_replace("'", '"', $name);
36
        }
37
38
        $this->assertSame($name, implode(' ', $configCmd->getName()));
39
        $this->assertSame($expected . $name, $configCmd->asString());
40
    }
41
}
42