From a946ad8317e1397d8484bb1c3d43a69a07b52822 Mon Sep 17 00:00:00 2001 From: peter279k Date: Sun, 24 Jan 2021 00:37:58 +0800 Subject: [PATCH] Improve PHPUnit fixtures and require-dev setting --- composer.json | 9 ++++++--- tests/Unit/DataFilterTest.php | 2 +- tests/Unit/DataParserTest.php | 2 +- tests/Unit/DataTrimmerTest.php | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 03e1057..f4aa661 100644 --- a/composer.json +++ b/composer.json @@ -10,16 +10,19 @@ ], "require" : { - "php" : "^7.2", + "php" : "^7.2" + }, + + "require-dev": { "phpunit/phpunit": "^8.3" }, "autoload" : { "psr-4" : { "Vstat\\" : "src/Vstat/" - } + } }, - + "autoload-dev" : { "psr-4": { "Tests\\": "tests/" diff --git a/tests/Unit/DataFilterTest.php b/tests/Unit/DataFilterTest.php index 73b3886..68377fd 100644 --- a/tests/Unit/DataFilterTest.php +++ b/tests/Unit/DataFilterTest.php @@ -25,7 +25,7 @@ class DataFilterTest extends TestCase /** * setting up our test object. */ - public function setUp() : void + protected function setUp() : void { $this->dataFilter = new DataFilter(); } diff --git a/tests/Unit/DataParserTest.php b/tests/Unit/DataParserTest.php index 06491a3..784cf58 100644 --- a/tests/Unit/DataParserTest.php +++ b/tests/Unit/DataParserTest.php @@ -35,7 +35,7 @@ class DataParserTest extends TestCase /** * setting up our test object. */ - public function setUp() : void + protected function setUp() : void { $this->parser = new DataParser(); } diff --git a/tests/Unit/DataTrimmerTest.php b/tests/Unit/DataTrimmerTest.php index 1f57e39..054b0e8 100644 --- a/tests/Unit/DataTrimmerTest.php +++ b/tests/Unit/DataTrimmerTest.php @@ -23,7 +23,7 @@ */ class DataTrimmerTest extends TestCase { - public function setUp() : void + protected function setUp() : void { $this->dataTrimmer = new DataTrimmer(); $this->parser = new DataParser();