IdentifyCommandTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A identifyCommand() 0 17 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
namespace Siad007\VersionControl\HG\Tests\Command;
13
14
use Siad007\VersionControl\HG\Factory;
15
use Siad007\VersionControl\HG\Tests\Helpers\TestCase;
16
17
class IdentifyCommandTest extends TestCase
18
{
19
    /**
20
     * @test
21
     */
22
    public function identifyCommand()
23
    {
24
        $identifyCmd = Factory::createIdentify();
25
        $identifyCmd->setSource('C:\\xampp\\source\\');
26
        $identifyCmd->setNum(true);
27
        $identifyCmd->setInsecure(true);
28
29
        $source = '\'C:\xampp\source\\\'';
30
        $expected = "hg identify --num --insecure ";
31
32
        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
33
            $source = str_replace("'", '"', $source);
34
        }
35
36
        $this->assertSame($source, $identifyCmd->getSource());
37
        $this->assertSame($expected . $source, $identifyCmd->asString());
38
    }
39
}
40