aboutsummaryrefslogtreecommitdiffstats
path: root/library/kzykhys/git/test/PHPGit/Exception/GitExceptionTest.php
blob: 154d6b906090256386a266105b6a141d6cf54909 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

use PHPGit\Exception\GitException;
use PHPGit\Git;

class GitExceptionTest extends PHPUnit_Framework_TestCase
{

    public function testException()
    {
        $git = new Git();
        $git->setRepository(sys_get_temp_dir());
        try {
            $git->status();
            $this->fail('Previous operation should fail');
        } catch (GitException $e) {
            $command = $e->getCommandLine();
            $command = str_replace(array('"', "'"), '', $command);
            $this->assertStringEndsWith('status --porcelain -s -b --null', $command);
        }
    }

}