Skip to content

Commit 5536f1e

Browse files
committed
Updated and restructured ConfigTest
1 parent 19a9135 commit 5536f1e

File tree

1 file changed

+39
-33
lines changed

1 file changed

+39
-33
lines changed

tests/ConfigTest.php

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,73 @@
77

88
class ConfigTest extends TestCase
99
{
10-
public function test_it_has_uppercase_config_options()
10+
public function test_it_has_base64_config_options()
1111
{
12-
$this->assertEquals(Twine\Config\Uppercase::ALL, 'strtoupper');
13-
$this->assertEquals(Twine\Config\Uppercase::FIRST, 'ucfirst');
14-
$this->assertEquals(Twine\Config\Uppercase::WORDS, 'ucwords');
12+
$this->assertEquals('base64_encode', Twine\Config\Base64::ENCODE);
13+
$this->assertEquals('base64_decode', Twine\Config\Base64::DECODE);
1514
}
1615

17-
public function test_it_has_lowercase_config_options()
16+
public function test_it_has_equals_config_options()
1817
{
19-
$this->assertEquals(Twine\Config\Lowercase::ALL, 'strtolower');
20-
$this->assertEquals(Twine\Config\Lowercase::FIRST, 'lcfirst');
21-
$this->assertEquals(Twine\Config\Lowercase::WORDS, 'lcwords');
18+
$this->assertEquals('strcmp', Twine\Config\Equals::CASE_SENSITIVE);
19+
$this->assertEquals('strcasecmp', Twine\Config\Equals::CASE_INSENSITIVE);
2220
}
2321

24-
public function test_it_has_trim_config_options()
22+
public function test_it_has_hex_config_options()
2523
{
26-
$this->assertEquals(Twine\Config\Trim::BOTH, 'trim');
27-
$this->assertEquals(Twine\Config\Trim::LEFT, 'ltrim');
28-
$this->assertEquals(Twine\Config\Trim::RIGHT, 'rtrim');
24+
$this->assertEquals('encode', Twine\Config\Hex::ENCODE);
25+
$this->assertEquals('decode', Twine\Config\Hex::DECODE);
2926
}
3027

31-
public function test_it_has_wrap_config_options()
28+
public function test_it_has_lowercase_config_options()
3229
{
33-
$this->assertFalse(Twine\Config\Wrap::SOFT);
34-
$this->assertTrue(Twine\Config\Wrap::HARD);
30+
$this->assertEquals('strtolower', Twine\Config\Lowercase::ALL);
31+
$this->assertEquals('lcfirst', Twine\Config\Lowercase::FIRST);
32+
$this->assertEquals('lcwords', Twine\Config\Lowercase::WORDS);
33+
}
34+
35+
public function test_it_has_md5_config_options()
36+
{
37+
$this->assertFalse(Twine\Config\Md5::DEFAULT);
38+
$this->assertTrue(Twine\Config\Md5::RAW);
3539
}
3640

3741
public function test_it_has_pad_config_options()
3842
{
39-
$this->assertEquals(Twine\Config\Pad::RIGHT, STR_PAD_RIGHT);
40-
$this->assertEquals(Twine\Config\Pad::LEFT, STR_PAD_LEFT);
41-
$this->assertEquals(Twine\Config\Pad::BOTH, STR_PAD_BOTH);
43+
$this->assertEquals(STR_PAD_RIGHT, Twine\Config\Pad::RIGHT);
44+
$this->assertEquals(STR_PAD_LEFT, Twine\Config\Pad::LEFT);
45+
$this->assertEquals(STR_PAD_BOTH, Twine\Config\Pad::BOTH);
4246
}
4347

44-
public function test_it_has_base64_config_options()
48+
public function test_it_has_sha1_config_options()
4549
{
46-
$this->assertEquals(Twine\Config\Base64::ENCODE, 'base64_encode');
47-
$this->assertEquals(Twine\Config\Base64::DECODE, 'base64_decode');
50+
$this->assertFalse(Twine\Config\Sha1::DEFAULT);
51+
$this->assertTrue(Twine\Config\Sha1::RAW);
4852
}
4953

50-
public function test_it_has_equals_config_options()
54+
public function test_it_has_sha256_config_options()
5155
{
52-
$this->assertEquals(Twine\Config\Equals::CASE_SENSITIVE, 'strcmp');
53-
$this->assertEquals(Twine\Config\Equals::CASE_INSENSITIVE, 'strcasecmp');
56+
$this->assertFalse(Twine\Config\Sha256::DEFAULT);
57+
$this->assertTrue(Twine\Config\Sha256::RAW);
5458
}
5559

56-
public function test_it_has_md5_config_options()
60+
public function test_it_has_trim_config_options()
5761
{
58-
$this->assertFalse(Twine\Config\Md5::DEFAULT);
59-
$this->assertTrue(Twine\Config\Md5::RAW);
62+
$this->assertEquals('trim', Twine\Config\Trim::BOTH);
63+
$this->assertEquals('ltrim', Twine\Config\Trim::LEFT);
64+
$this->assertEquals('rtrim', Twine\Config\Trim::RIGHT);
6065
}
6166

62-
public function test_it_has_sha1_config_options()
67+
public function test_it_has_uppercase_config_options()
6368
{
64-
$this->assertFalse(Twine\Config\Sha1::DEFAULT);
65-
$this->assertTrue(Twine\Config\Sha1::RAW);
69+
$this->assertEquals('strtoupper', Twine\Config\Uppercase::ALL);
70+
$this->assertEquals('ucfirst', Twine\Config\Uppercase::FIRST);
71+
$this->assertEquals('ucwords', Twine\Config\Uppercase::WORDS);
6672
}
6773

68-
public function test_it_has_sha256_config_options()
74+
public function test_it_has_wrap_config_options()
6975
{
70-
$this->assertFalse(Twine\Config\Sha256::DEFAULT);
71-
$this->assertTrue(Twine\Config\Sha256::RAW);
76+
$this->assertFalse(Twine\Config\Wrap::SOFT);
77+
$this->assertTrue(Twine\Config\Wrap::HARD);
7278
}
7379
}

0 commit comments

Comments
 (0)