OSDN Git Service

add more unit tests
authorfrostbane <frostbane@programmer.net>
Fri, 15 Nov 2019 03:43:53 +0000 (12:43 +0900)
committerfrostbane <frostbane@programmer.net>
Fri, 15 Nov 2019 03:43:53 +0000 (12:43 +0900)
phpunit.xml
tests/DocBlockReader/ReaderTest.php

index 086e481..21c6fe5 100644 (file)
@@ -7,8 +7,7 @@
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          processIsolation="false"
-         stopOnFailure="true"
-         syntaxCheck="false">
+         stopOnFailure="true">
     <testsuites>
         <testsuite name="Simple Annotations Test Suite">
             <directory>./tests/DocBlockReader/</directory>
index 43f480e..0cb6a14 100644 (file)
@@ -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
      *
      */