From 0f38cb4f89be94925c8dc4bdb4de003c21b0d1dc Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Tue, 2 Nov 2021 09:33:04 +0900 Subject: [PATCH] Stub tests for Check::File --- 4dev/tests/CoreLibsCheckFileTest.php | 59 +++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/4dev/tests/CoreLibsCheckFileTest.php b/4dev/tests/CoreLibsCheckFileTest.php index c59c9199..57e618c0 100644 --- a/4dev/tests/CoreLibsCheckFileTest.php +++ b/4dev/tests/CoreLibsCheckFileTest.php @@ -8,32 +8,81 @@ use PHPUnit\Framework\TestCase; /** * Undocumented class - * @testdox CoreLibs\Convert\Math method tests + * @testdox CoreLibs\Check\File method tests */ final class CoreLibsCheckFileTest extends TestCase { + /** @var array */ + private $files = []; + protected function setUp(): void { - // write a dummy file for testing + // write a dummy files for testing } protected function tearDown(): void { - // unlink file + // unlink files } - public function testGetFilenameEnding(string $input, string $expected): void + /** + * main file list + data provider + * + * @return array + */ + public function filesList(): array + { + return [ + ['filename.txt', 'txt', 5] + ]; + } + + public function filesExtensionProvider(): array + { + $list = []; + foreach ($this->filesList as $row) { + $list[$row[0] . ' must be extension ' . $row[1]] = [$row[0], $row[1]]; + } + return $list; + } + + /** + * Undocumented function + * + * @#dataProvider filesExtensionProvider + * @#testdox File::getFilenameEnding Input $input must be $expected + * //string $input, string $expected + * + * @param string $input + * @param string $expected + * @return void + */ + public function testGetFilenameEnding(): void { // getFilenameEnding - $this->assertEquals( + /* $this->assertEquals( $expected, \CoreLibs\Check\File::getFilenameEnding($input) + ); */ + $this->assertTrue(true, 'This should already work.'); + $this->markTestIncomplete( + 'testGetFilenameEnding has not been implemented yet.' ); } + /** + * Undocumented function + * // string $input, string $expected + * + * @return void + */ public function testGetLinesFromFile(): void { // getLinesFromFile + $this->assertTrue(true, 'This should already work.'); + $this->markTestIncomplete( + 'testGetLinesFromFile has not been implemented yet.' + ); } }