PHP Classes

File: tests/HammingTest.php

Recommend this page to a friend!
  Classes of mohammad anzawi   PHP Similarity Between Two Strings   tests/HammingTest.php   Download  
File: tests/HammingTest.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Similarity Between Two Strings
Calculate the similarity level of two text strings
Author: By
Last change:
Date: 2 years ago
Size: 442 bytes
 

Contents

Class file image Download
<?php

namespace Anzawi\FindDiff;

use
PHPUnit\Framework\TestCase;

class
HammingTest extends TestCase
{
    protected
string $firstString = "this is a test";
    protected
string $secondString = "this is test";

    public function
testCalculate()
    {
       
$hamming = Hamming::calculate($this->firstString, $this->secondString);
       
$this->assertIsInt($hamming);
       
$this->assertEquals(4, $hamming);
    }
}