From 47f260b5f03d96847f4cd45c9eef9f414a4e8ca3 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Fri, 24 Mar 2017 16:27:14 -0400 Subject: [PATCH] Test coverage for every line! --- src/functions.php | 2 +- tests/functionsTest.php | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tests/functionsTest.php diff --git a/src/functions.php b/src/functions.php index e5e5ea5..78b20ff 100644 --- a/src/functions.php +++ b/src/functions.php @@ -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); } \ No newline at end of file diff --git a/tests/functionsTest.php b/tests/functionsTest.php new file mode 100644 index 0000000..f61b738 --- /dev/null +++ b/tests/functionsTest.php @@ -0,0 +1,33 @@ + + * @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); + } +} \ No newline at end of file