Skip to content

Commit

Permalink
Aim for 100% code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Jan 25, 2018
1 parent 2e82805 commit e272563
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
3 changes: 3 additions & 0 deletions src/Util.php
Expand Up @@ -33,6 +33,7 @@ final class Util
/**
* Don't allow this to be instantiated.
* @throws \Error
* @codeCoverageIgnore
*/
final private function __construct()
{
Expand Down Expand Up @@ -64,6 +65,7 @@ public static function chrToInt(string $chr): int
* @param int $length
* @return string
* @throws CannotPerformOperation
* @throws \TypeError
*/
public static function hash(
string $input,
Expand Down Expand Up @@ -203,6 +205,7 @@ public static function intToChr(int $int): string
* @param int $length
* @return string
* @throws CannotPerformOperation
* @throws \TypeError
*/
public static function keyed_hash(
string $input,
Expand Down
16 changes: 2 additions & 14 deletions test/unit/UtilTest.php
Expand Up @@ -18,20 +18,6 @@
*/
final class UtilTest extends TestCase
{
/**
* @expectedException \Error
*
* @throws Error
* @throws InvalidType
*/
public function testConstructorFail()
{
// Please ignore IDE errors here.
/** @noinspection Annotator */
$x = new Util();
$this->assertSame('', $x::xorStrings('', ''));
}

public function testChrToInt()
{
$this->assertSame(0x61, Util::chrToInt("a"));
Expand Down Expand Up @@ -65,6 +51,7 @@ public function testStringToIntArray()
* BLAKE2b hash
*
* @throws CannotPerformOperation
* @throws TypeError
*/
public function testHash()
{
Expand All @@ -84,6 +71,7 @@ public function testHash()
* BLAKE2b hash
*
* @throws CannotPerformOperation
* @throws TypeError
*/
public function testKeyedHash()
{
Expand Down

0 comments on commit e272563

Please sign in to comment.