From 936ee5caca3067de98a40d5a5788946b6f2b87dc Mon Sep 17 00:00:00 2001 From: "Chun-Sheng, Li" Date: Wed, 6 Jan 2021 08:07:33 +0800 Subject: [PATCH] Improve autoloading, asssertions and CI trigger (#79) --- composer.json | 9 +++++++-- tests/MathTest.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 3024ee7..6c2dd75 100644 --- a/composer.json +++ b/composer.json @@ -29,8 +29,13 @@ "phpunit/phpunit": ">=8.0" }, "autoload": { - "psr-0": { - "NXP": "src/" + "psr-4": { + "NXP\\": "src/NXP" + } + }, + "autoload-dev": { + "psr-4": { + "NXP\\Tests\\": "tests/" } } } diff --git a/tests/MathTest.php b/tests/MathTest.php index a5061ad..47d89b8 100644 --- a/tests/MathTest.php +++ b/tests/MathTest.php @@ -504,7 +504,7 @@ public function testSetVarsAcceptsAllScalars() $calculator->setVar('null', null); $calculator->setVar('float', 1.1); $calculator->setVar('string', 'string'); - $this->assertEquals(8, count($calculator->getVars())); + $this->assertCount(8, $calculator->getVars()); $this->assertEquals(true, $calculator->getVar('boolTrue')); $this->assertEquals(false, $calculator->getVar('boolFalse')); $this->assertEquals(1, $calculator->getVar('int'));