From 86dbf18caa035bcf1eb52574457536fedabe8596 Mon Sep 17 00:00:00 2001 From: frostbane Date: Fri, 15 Nov 2019 12:43:53 +0900 Subject: [PATCH 1/1] add more unit tests --- phpunit.xml | 3 +-- tests/DocBlockReader/ReaderTest.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index 086e481..21c6fe5 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,8 +7,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="true" - syntaxCheck="false"> + stopOnFailure="true"> ./tests/DocBlockReader/ diff --git a/tests/DocBlockReader/ReaderTest.php b/tests/DocBlockReader/ReaderTest.php index 43f480e..0cb6a14 100644 --- a/tests/DocBlockReader/ReaderTest.php +++ b/tests/DocBlockReader/ReaderTest.php @@ -16,10 +16,13 @@ use PHPUnit\Framework\TestCase; * * @trueVar * @null-var null + * @string4 "null" * * @booleanTrue true * @string3 tRuE * @booleanFalse false + * @string5 "true" + * @string6 "false" * @booleanNull null * */ @@ -36,10 +39,13 @@ class ReaderTest extends TestCase * * @trueVar * @null-var null + * @string4 "null" * * @booleanTrue true * @string3 tRuE * @booleanFalse false + * @string5 "true" + * @string6 "false" * @booleanNull null * */ @@ -100,6 +106,11 @@ class ReaderTest extends TestCase $this->assertArrayHasKey('number', $parameters); $this->assertArrayHasKey('string', $parameters); + $this->assertArrayHasKey('string2', $parameters); + $this->assertArrayHasKey('string3', $parameters); + $this->assertArrayHasKey('string4', $parameters); + $this->assertArrayHasKey('string5', $parameters); + $this->assertArrayHasKey('string6', $parameters); $this->assertArrayHasKey('array', $parameters); $this->assertArrayHasKey('object', $parameters); $this->assertArrayHasKey('nested', $parameters); @@ -123,6 +134,8 @@ class ReaderTest extends TestCase $this->assertSame(true, $parameters['booleanTrue']); $this->assertSame("tRuE", $parameters['string3']); + $this->assertSame("true", $parameters['string5']); + $this->assertSame("false", $parameters['string6']); $this->assertSame(false, $parameters['booleanFalse']); $this->assertSame(null, $parameters['booleanNull']); } @@ -188,10 +201,13 @@ class ReaderTest extends TestCase * * @trueVar * @null-var null + * @string4 "null" * * @booleanTrue true * @string3 tRuE * @booleanFalse false + * @string5 "true" + * @string6 "false" * @booleanNull null * */ -- 2.11.0