Security update for Core, with self-updated composer
[yaffs-website] / vendor / consolidation / annotated-command / tests / testHelp.php
index e9d8a765b5a6236669c00abb09e784db40797488..e589861b67d7ee47d08dd604aacdb4ba0c9f21a1 100644 (file)
@@ -40,7 +40,7 @@ class HelpTests extends \PHPUnit_Framework_TestCase
         $alterOptionsEventManager = new AlterOptionsCommandEvent($this->application);
         $eventDispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher();
         $eventDispatcher->addSubscriber($this->commandFactory->commandProcessor()->hookManager());
-        $eventDispatcher->addSubscriber($alterOptionsEventManager);
+        $this->commandFactory->commandProcessor()->hookManager()->addCommandEvent($alterOptionsEventManager);
         $this->application->setDispatcher($eventDispatcher);
         $this->application->setAutoExit(false);
 
@@ -102,7 +102,7 @@ class HelpTests extends \PHPUnit_Framework_TestCase
 
     function simplifyWhitespace($data)
     {
-        return trim(preg_replace('#[ \t]+$#m', '', $data));
+        return trim(preg_replace('#\s+$#m', '', $data));
     }
 
     function testHelp()
@@ -111,7 +111,7 @@ class HelpTests extends \PHPUnit_Framework_TestCase
 <?xml version="1.0" encoding="UTF-8"?>
 <command id="example:table" name="example:table">
   <usages>
-    <usage>example:table [--format [FORMAT]] [--fields [FIELDS]] [--field [FIELD]] [--] [&lt;unused&gt;]</usage>
+    <usage>example:table [--format [FORMAT]] [--fields [FIELDS]] [--field FIELD] [--] [&lt;unused&gt;]</usage>
   </usages>
   <examples>
     <example>
@@ -145,7 +145,7 @@ class HelpTests extends \PHPUnit_Framework_TestCase
       <description>Available fields: I (first), II (second), III (third)</description>
       <defaults/>
     </option>
-    <option name="--field" shortcut="" accept_value="1" is_value_required="0" is_multiple="0">
+    <option name="--field" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
       <description>Select just one field, and force format to 'string'.</description>
       <defaults/>
     </option>
@@ -188,7 +188,7 @@ EOT;
     "id": "example:table",
     "name": "example:table",
     "usages": [
-        "example:table [--format [FORMAT]] [--fields [FIELDS]] [--field [FIELD]] [--] [<unused>]"
+        "example:table [--format [FORMAT]] [--fields [FIELDS]] [--field FIELD] [--] [<unused>]"
     ],
     "examples": [
         {
@@ -237,7 +237,7 @@ EOT;
             "name": "--field",
             "shortcut": "",
             "accept_value": "1",
-            "is_value_required": "0",
+            "is_value_required": "1",
             "is_multiple": "0",
             "description": "Select just one field, and force format to 'string'."
         },
@@ -300,7 +300,9 @@ EOT;
         }
     },
     "help": "Test command with formatters",
-    "alias": "extab",
+    "aliases": [
+        "extab"
+    ],
     "topics": [
         "docs-tables"
     ]