DiffMatchPatch\DiffToolkitTest::testCommonPrefix PHP Method

testCommonPrefix() public method

public testCommonPrefix ( )
    public function testCommonPrefix()
    {
        // Detect any common prefix.
        // Null case.
        $this->assertEquals(0, $this->dt->commonPrefix("abc", "xyz"));
        // Non-null case.
        $this->assertEquals(4, $this->dt->commonPrefix("1234abcdef", "1234xyz"));
        // Whole case.
        $this->assertEquals(4, $this->dt->commonPrefix("1234", "1234xyz"));
    }