GitWrapper\Test\GitWorkingCopyTest::testIsUpToDate PHP Method

testIsUpToDate() public method

public testIsUpToDate ( )
    public function testIsUpToDate()
    {
        $git = $this->getWorkingCopy();
        // The default test branch is up-to-date with its remote.
        $git->checkout('test-branch');
        $this->assertTrue($git->isUpToDate());
        // If we create a new commit, we are still up-to-date.
        file_put_contents(self::WORKING_DIR . '/commit.txt', "created\n");
        $git->add('commit.txt')->commit(array('m' => '1 commit ahead. Still up-to-date.', 'a' => true));
        $this->assertTrue($git->isUpToDate());
        // Reset the branch to its first commit, so that it is 1 commit behind.
        $git->reset('HEAD~2', array('hard' => true));
        $this->assertFalse($git->isUpToDate());
    }