Sha256: 18818a35abb89e590dae1b40b9d03d390af19117d80482221016e692e454d951

Contents?: true

Size: 1.44 KB

Versions: 195

Compression:

Stored size: 1.44 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', 'DNA strands must be of equal length.');
        distance('GGACG', 'AGGACGTGG');
    }
}

Version data entries

195 entries across 195 versions & 1 rubygems

Version Path
trackler-2.2.1.33 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.32 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.31 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.30 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.29 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.28 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.27 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.26 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.25 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.24 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.23 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.22 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.21 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.20 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.19 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.18 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.17 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.16 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.15 tracks/php/exercises/hamming/hamming_test.php
trackler-2.2.1.14 tracks/php/exercises/hamming/hamming_test.php