From 5536f1e740e0674cb452a8e2431f44abd36ee5bf Mon Sep 17 00:00:00 2001 From: Chris Kankiewicz Date: Thu, 19 Jul 2018 23:16:09 -0700 Subject: [PATCH] Updated and restructured ConfigTest --- tests/ConfigTest.php | 72 ++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 1a455eb..f1313d6 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -7,67 +7,73 @@ class ConfigTest extends TestCase { - public function test_it_has_uppercase_config_options() + public function test_it_has_base64_config_options() { - $this->assertEquals(Twine\Config\Uppercase::ALL, 'strtoupper'); - $this->assertEquals(Twine\Config\Uppercase::FIRST, 'ucfirst'); - $this->assertEquals(Twine\Config\Uppercase::WORDS, 'ucwords'); + $this->assertEquals('base64_encode', Twine\Config\Base64::ENCODE); + $this->assertEquals('base64_decode', Twine\Config\Base64::DECODE); } - public function test_it_has_lowercase_config_options() + public function test_it_has_equals_config_options() { - $this->assertEquals(Twine\Config\Lowercase::ALL, 'strtolower'); - $this->assertEquals(Twine\Config\Lowercase::FIRST, 'lcfirst'); - $this->assertEquals(Twine\Config\Lowercase::WORDS, 'lcwords'); + $this->assertEquals('strcmp', Twine\Config\Equals::CASE_SENSITIVE); + $this->assertEquals('strcasecmp', Twine\Config\Equals::CASE_INSENSITIVE); } - public function test_it_has_trim_config_options() + public function test_it_has_hex_config_options() { - $this->assertEquals(Twine\Config\Trim::BOTH, 'trim'); - $this->assertEquals(Twine\Config\Trim::LEFT, 'ltrim'); - $this->assertEquals(Twine\Config\Trim::RIGHT, 'rtrim'); + $this->assertEquals('encode', Twine\Config\Hex::ENCODE); + $this->assertEquals('decode', Twine\Config\Hex::DECODE); } - public function test_it_has_wrap_config_options() + public function test_it_has_lowercase_config_options() { - $this->assertFalse(Twine\Config\Wrap::SOFT); - $this->assertTrue(Twine\Config\Wrap::HARD); + $this->assertEquals('strtolower', Twine\Config\Lowercase::ALL); + $this->assertEquals('lcfirst', Twine\Config\Lowercase::FIRST); + $this->assertEquals('lcwords', Twine\Config\Lowercase::WORDS); + } + + public function test_it_has_md5_config_options() + { + $this->assertFalse(Twine\Config\Md5::DEFAULT); + $this->assertTrue(Twine\Config\Md5::RAW); } public function test_it_has_pad_config_options() { - $this->assertEquals(Twine\Config\Pad::RIGHT, STR_PAD_RIGHT); - $this->assertEquals(Twine\Config\Pad::LEFT, STR_PAD_LEFT); - $this->assertEquals(Twine\Config\Pad::BOTH, STR_PAD_BOTH); + $this->assertEquals(STR_PAD_RIGHT, Twine\Config\Pad::RIGHT); + $this->assertEquals(STR_PAD_LEFT, Twine\Config\Pad::LEFT); + $this->assertEquals(STR_PAD_BOTH, Twine\Config\Pad::BOTH); } - public function test_it_has_base64_config_options() + public function test_it_has_sha1_config_options() { - $this->assertEquals(Twine\Config\Base64::ENCODE, 'base64_encode'); - $this->assertEquals(Twine\Config\Base64::DECODE, 'base64_decode'); + $this->assertFalse(Twine\Config\Sha1::DEFAULT); + $this->assertTrue(Twine\Config\Sha1::RAW); } - public function test_it_has_equals_config_options() + public function test_it_has_sha256_config_options() { - $this->assertEquals(Twine\Config\Equals::CASE_SENSITIVE, 'strcmp'); - $this->assertEquals(Twine\Config\Equals::CASE_INSENSITIVE, 'strcasecmp'); + $this->assertFalse(Twine\Config\Sha256::DEFAULT); + $this->assertTrue(Twine\Config\Sha256::RAW); } - public function test_it_has_md5_config_options() + public function test_it_has_trim_config_options() { - $this->assertFalse(Twine\Config\Md5::DEFAULT); - $this->assertTrue(Twine\Config\Md5::RAW); + $this->assertEquals('trim', Twine\Config\Trim::BOTH); + $this->assertEquals('ltrim', Twine\Config\Trim::LEFT); + $this->assertEquals('rtrim', Twine\Config\Trim::RIGHT); } - public function test_it_has_sha1_config_options() + public function test_it_has_uppercase_config_options() { - $this->assertFalse(Twine\Config\Sha1::DEFAULT); - $this->assertTrue(Twine\Config\Sha1::RAW); + $this->assertEquals('strtoupper', Twine\Config\Uppercase::ALL); + $this->assertEquals('ucfirst', Twine\Config\Uppercase::FIRST); + $this->assertEquals('ucwords', Twine\Config\Uppercase::WORDS); } - public function test_it_has_sha256_config_options() + public function test_it_has_wrap_config_options() { - $this->assertFalse(Twine\Config\Sha256::DEFAULT); - $this->assertTrue(Twine\Config\Sha256::RAW); + $this->assertFalse(Twine\Config\Wrap::SOFT); + $this->assertTrue(Twine\Config\Wrap::HARD); } }