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.0.8.36 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.35 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.34 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.33 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.32 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.31 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.30 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.29 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.28 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.27 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.26 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.24 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.23 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.22 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.21 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.20 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.19 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.18 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.17 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.16 tracks/php/exercises/etl/etl_test.php