Skip to content

Commit

Permalink
Updated and restructured ConfigTest
Browse files Browse the repository at this point in the history
  • Loading branch information
PHLAK committed Jul 22, 2018
1 parent 19a9135 commit 5536f1e
Showing 1 changed file with 39 additions and 33 deletions.
72 changes: 39 additions & 33 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 5536f1e

Please sign in to comment.