Sha256: faba3787f4b943a4d43a5d8c38194dd2cc3fa3bfdb1b2421fb534890213faeab

Contents?: true

Size: 1.48 KB

Versions: 229

Compression:

Stored size: 1.48 KB

Contents

<?php
require "sum-of-multiples.php";

class SumOfMultiplesTest extends PHPUnit\Framework\TestCase
{
    public function testSumToOne()
    {
        $this->assertEquals(0, sumOfMultiples(1, [3, 5]));
    }

    public function testSumToThree()
    {
        $this->assertEquals(3, sumOfMultiples(4, [3, 5]));
    }

    public function testSumToTen()
    {
        $this->assertEquals(23, sumOfMultiples(10, [3, 5]));
    }

    public function testSumToTwenty()
    {
        $this->assertEquals(78, sumOfMultiples(20, [3, 5]));
    }

    public function testSumToHundred()
    {
        $this->assertEquals(2318, sumOfMultiples(100, [3, 5]));
    }

    public function testSumToThousand()
    {
        $this->assertEquals(233168, sumOfMultiples(1000, [3, 5]));
    }

    public function testConfigureToTwenty()
    {
        $this->assertEquals(51, sumOfMultiples(20, [7, 13, 17]));
    }

    public function testConfigureToFifteen()
    {
        $this->assertEquals(30, sumOfMultiples(15, [4, 6]));
    }

    public function testConfigureToOneFifty()
    {
        $this->assertEquals(4419, sumOfMultiples(150, [5, 6, 8]));
    }

    public function testConfigureToFortySeven()
    {
        $this->assertEquals(2203160, sumOfMultiples(10000, [43, 47]));
    }

    public function testMultiplesOfOneToHundred()
    {
        $this->assertEquals(4950, sumOfMultiples(100, [1]));
    }
    public function testMultiplesOfEmptyList()
    {
        $this->assertEquals(0, sumOfMultiples(1000, [0]));
    }
}

Version data entries

229 entries across 229 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.158 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.157 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.156 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.155 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.154 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.153 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.152 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.151 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.150 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.149 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.148 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.147 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.146 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.145 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.144 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.143 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.142 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.141 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.140 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php