Test coverage for every line!
This commit is contained in:
parent
65105a0559
commit
47f260b5f0
@ -23,7 +23,7 @@ namespace Aviat\Ion;
|
|||||||
* @param string[] ...$args
|
* @param string[] ...$args
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function _dir(...$args)
|
function _dir(string ...$args): string
|
||||||
{
|
{
|
||||||
return implode(DIRECTORY_SEPARATOR, $args);
|
return implode(DIRECTORY_SEPARATOR, $args);
|
||||||
}
|
}
|
33
tests/functionsTest.php
Normal file
33
tests/functionsTest.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user