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.180 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.179 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.178 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.177 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.176 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.175 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.174 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.173 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.172 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.171 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.170 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.169 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.167 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.166 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.165 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.164 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.163 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.162 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.161 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php
trackler-2.2.1.160 tracks/php/exercises/sum-of-multiples/sum-of-multiples_test.php