1
exercism fetch php crypto-square

crypto-square_test.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php

require_once "crypto-square.php";

class CryptoSquareTest extends PHPUnit\Framework\TestCase
{
    public function testEmptyPlaintextResultsInAnEmptyCiphertext()
    {
        $this->assertEquals(crypto_square(""), "");
    }

    public function testLowercase()
    {
        $this->markTestSkipped();
        $this->assertEquals(crypto_square("A"), "a");
    }

    public function testRemoveSpaces()
    {
        $this->markTestSkipped();
        $this->assertEquals(crypto_square("  b "), "b");
    }

    public function testRemovePunctuation()
    {
        $this->markTestSkipped();
        $this->assertEquals(crypto_square("@1,%!"), "1");
    }

    public function test9CharacterPlaintextResultsIn3ChunksOf3Characters()
    {
        $this->markTestSkipped();
        $this->assertEquals(crypto_square("This is fun!"), "tsf hiu isn");
    }

    public function test8CharacterPlaintextResultsIn3ChunksTheLastOneWithATrailingSpace()
    {
        $this->markTestSkipped();
        $this->assertEquals(crypto_square("Chill out."), "clu hlt io ");
    }

    public function test54CharacterPlaintextResultsIn7ChunksTheLastTwoWithTrailingSpaces()
    {
        $this->markTestSkipped();
        $this->assertEquals(
            crypto_square("If man was meant to stay on the ground, god would have given us roots."),
            "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn  sseoau "
        );
    }
}