Test coverage for every line!

This commit is contained in:
Timothy Warren 2017-03-24 16:27:14 -04:00
parent 65105a0559
commit 47f260b5f0
2 changed files with 34 additions and 1 deletions

View File

@ -23,7 +23,7 @@ namespace Aviat\Ion;
* @param string[] ...$args
* @return string
*/
function _dir(...$args)
function _dir(string ...$args): string
{
return implode(DIRECTORY_SEPARATOR, $args);
}

33
tests/functionsTest.php Normal file
View File

@ -0,0 +1,33 @@
<?php declare(strict_types=1);
/**
* Ion
*
* Building blocks for web development
*
* PHP version 7
*
* @package Ion
* @author Timothy J. Warren <tim@timshomepage.net>
* @copyright 2015 - 2017 Timothy J. Warren
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version 2.0.0
* @link https://git.timshomepage.net/timw4mail/ion
*/
namespace Aviat\Ion\Tests;
use function Aviat\Ion\_dir;
use PHPUnit\Framework\TestCase;
class functionsTest extends TestCase {
public function test_dir()
{
$args = ['foo', 'bar', 'baz'];
$expected = implode(\DIRECTORY_SEPARATOR, $args);
$this->assertEquals(_dir(...$args), $expected);
}
}