浏览代码

Fix tests

shalvah 4 年之前
父节点
当前提交
06bed6483e
共有 5 个文件被更改,包括 21 次插入21 次删除
  1. 0 2
      .travis.yml
  2. 2 2
      composer.dingo.json
  3. 3 3
      composer.json
  4. 13 11
      phpunit.xml
  5. 3 3
      tests/Unit/PostmanCollectionWriterTest.php

+ 0 - 2
.travis.yml

@@ -23,8 +23,6 @@ matrix:
     - php: 7.4
       env: SETUP=lowest
     - php: 8.0
-    - php: 8.0
-      env: SETUP=lowest
 
 cache:
   directories:

+ 2 - 2
composer.dingo.json

@@ -36,14 +36,14 @@
         "symfony/yaml": "^4.0|^5.0"
     },
     "require-dev": {
-        "brianium/paratest": "^5.0 | ^6.0",
+        "brianium/paratest": "^5.0|^6.0",
         "dms/phpunit-arraysubset-asserts": "^0.2.0",
         "league/fractal": "^0.19.0",
         "laravel/legacy-factories": "^1.0.4",
         "laravel/lumen-framework": "^6.0|^7.0|^8.0",
         "orchestra/testbench": "^4.0|^5.0|^6.0",
         "phpstan/phpstan": "^0.12.19",
-        "phpunit/phpunit": "^8.0|^9.0"
+        "phpunit/phpunit": "^9.0"
     },
     "suggest": {
         "league/fractal": "Required for transformers support"

+ 3 - 3
composer.json

@@ -35,15 +35,15 @@
     "symfony/yaml": "^4.0|^5.0"
   },
   "require-dev": {
-    "brianium/paratest": "^5.0 | ^6.0",
+    "brianium/paratest": "^5.0|^6.0",
     "dms/phpunit-arraysubset-asserts": "^0.2.0",
     "laravel/legacy-factories": "^1.0.4",
     "laravel/lumen-framework": "^6.0|^7.0|^8.0",
     "league/fractal": "^0.19.0",
     "nikic/fast-route": "^1.3",
-    "orchestra/testbench": "^4.0|^5.0",
+    "orchestra/testbench": "^4.0|^5.0|^6.0",
     "phpstan/phpstan": "^0.12.19",
-    "phpunit/phpunit": "^8.0|^9.0"
+    "phpunit/phpunit": "^9.0"
   },
   "suggest": {
     "league/fractal": "Required for transformers support"

+ 13 - 11
phpunit.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<phpunit backupGlobals="false"
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         backupGlobals="false"
          backupStaticAttributes="false"
          bootstrap="vendor/autoload.php"
          cacheResult="true"
@@ -8,7 +9,17 @@
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
          processIsolation="false"
-         stopOnFailure="false">
+         stopOnFailure="false"
+         xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
+    <coverage>
+        <include>
+            <directory suffix=".php">src/</directory>
+        </include>
+        <exclude>
+            <file>src/ScribeServiceProvider.php</file>
+            <file>resources/views/pastel.blade.php</file>
+        </exclude>
+    </coverage>
     <testsuites>
         <testsuite name="Full Test">
             <file>tests/GenerateDocumentationTest.php</file>
@@ -30,13 +41,4 @@
             <file>tests/Unit/PostmanCollectionWriterTest.php</file>
         </testsuite>
     </testsuites>
-    <filter>
-        <whitelist>
-            <directory suffix=".php">src/</directory>
-            <exclude>
-                <file>src/ScribeServiceProvider.php</file>
-                <file>resources/views/pastel.blade.php</file>
-            </exclude>
-        </whitelist>
-    </filter>
 </phpunit>

+ 3 - 3
tests/Unit/PostmanCollectionWriterTest.php

@@ -169,7 +169,7 @@ class PostmanCollectionWriterTest extends TestCase
     }
 
     /** @test */
-    public function query_parameters_are_disabled_with_no_value_when_notRequired()
+    public function query_parameters_are_disabled_with_no_value_when_not_required()
     {
         $fakeRoute = $this->createMockRouteData('fake/path');
         $fakeRoute['queryParameters'] = [
@@ -198,13 +198,13 @@ class PostmanCollectionWriterTest extends TestCase
         $this->assertCount(2, $variableData);
         $this->assertContains([
             'key' => 'required',
-            'value' => null,
+            'value' => '',
             'description' => 'A required param with a null value',
             'disabled' => false,
         ], $variableData);
         $this->assertContains([
             'key' => 'not_required',
-            'value' => null,
+            'value' => '',
             'description' => 'A not required param with a null value',
             'disabled' => true,
         ], $variableData);