Sha256: 187087c0036237578b929f1a58f63f15e8231b9b49f92c5adb8fade3e49e0857

Contents?: true

Size: 1.62 KB

Versions: 300

Compression:

Stored size: 1.62 KB

Contents

<?php

require "etl.php";

class TransformTest extends PHPUnit\Framework\TestCase
{
    public function testTransformOneValue()
    {
        $old         = [ '1' => ['A'] ];
        $expected    = [ 'a' => 1 ];
        $this->assertEquals($expected, transform($old));
    }

    public function testTransformMoreValues()
    {
        $this->markTestSkipped();
        $old         = [ '1' => str_split('AEIOU') ];
        $expected    = [ 'a' => 1, 'e' => 1, 'i' => 1, 'o' => 1, 'u' => 1 ];
        $this->assertEquals($expected, transform($old));
    }

    public function testTransformMoreKeys()
    {
        $this->markTestSkipped();
        $old         = [ '1' => str_split('AE'), '2' => str_split('DG') ];
        $expected    = [ 'a' => 1, 'e' => 1, 'd' => 2, 'g' => 2 ];
        $this->assertEquals($expected, transform($old));
    }

    public function testTransformFullDataset()
    {
        $this->markTestSkipped();
        $old = [
            '1' => str_split('AEIOULNRST'),
            '2' => str_split('DG'),
            '3' => str_split('BCMP'),
            '4' => str_split('FHVWY'),
            '5' => str_split('K'),
            '8' => str_split('JX'),
            '10' => str_split('QZ')
        ];
        $expected = [
            'a' => 1, 'b' => 3, 'c' => 3, 'd' => 2, 'e' => 1,
            'f' => 4, 'g' => 2, 'h' => 4, 'i' => 1, 'j' => 8,
            'k' => 5, 'l' => 1, 'm' => 3, 'n' => 1, 'o' => 1,
            'p' => 3, 'q' => 10, 'r' => 1, 's' => 1, 't' => 1,
            'u' => 1, 'v' => 4, 'w' => 4, 'x' => 8, 'y' => 4,
            'z' => 10
        ];
        $this->assertEquals($expected, transform($old));
    }
}

Version data entries

300 entries across 300 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.179 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.178 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.177 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.176 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.175 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.174 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.173 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.172 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.171 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.170 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.169 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.167 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.166 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.165 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.164 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.163 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.162 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.161 tracks/php/exercises/etl/etl_test.php
trackler-2.2.1.160 tracks/php/exercises/etl/etl_test.php