Sha256: 82bc120fcc43e4373f75fc86701decbba9927727a08c92d955c9c65dfd1bbfa7

Contents?: true

Size: 1.48 KB

Versions: 105

Compression:

Stored size: 1.48 KB

Contents

<?php

require "hamming.php";

class HammingComparatorTest extends PHPUnit\Framework\TestCase
{

    public function testNoDifferenceBetweenIdenticalStrands()
    {
        $this->assertEquals(0, distance('A', 'A'));
    }

    public function testCompleteHammingDistanceOfForSingleNucleotideStrand()
    {
        $this->markTestSkipped();
        $this->assertEquals(1, distance('A', 'G'));
    }

    public function testCompleteHammingDistanceForSmallStrand()
    {
        $this->markTestSkipped();
        $this->assertEquals(2, distance('AG', 'CT'));
    }

    public function testSmallHammingDistance()
    {
        $this->markTestSkipped();
        $this->assertEquals(1, distance('AT', 'CT'));
    }

    public function testSmallHammingDistanceInLongerStrand()
    {
        $this->markTestSkipped();
        $this->assertEquals(1, distance('GGACG', 'GGTCG'));
    }

    public function testLargeHammingDistance()
    {
        $this->markTestSkipped();
        $this->assertEquals(4, distance('GATACA', 'GCATAA'));
    }

    public function testHammingDistanceInVeryLongStrand()
    {
        $this->markTestSkipped();
        $this->assertEquals(9, distance('GGACGGATTCTG', 'AGGACGGATTCT'));
    }

    public function testExceptionThrownWhenStrandsAreDifferentLength()
    {
        $this->markTestSkipped();
        $this->expectException('InvalidArgumentException');
        $this->expectExceptionMessage('DNA strands must be of equal length.');
        distance('GGACG', 'AGGACGTGG');
    }
}

Version data entries

105 entries across 105 versions & 1 rubygems

Version Path
trackler-2.2.1.98 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.97 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.96 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.95 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.94 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.93 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.92 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.91 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.90 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.89 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.88 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.87 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.86 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.85 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.84 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.83 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.82 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.81 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.80 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.79 tracks/php/exercises/hamming/hamming_test.php