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.1.0.0 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.55 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.54 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.53 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.52 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.51 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.50 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.49 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.48 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.47 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.46 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.45 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.44 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.43 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.42 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.41 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.40 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.39 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.38 tracks/php/exercises/etl/etl_test.php
trackler-2.0.8.37 tracks/php/exercises/etl/etl_test.php