Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / psy / psysh / test / TabCompletion / AutoCompleterTest.php
similarity index 60%
rename from vendor/psy/psysh/test/Psy/Test/TabCompletion/AutoCompleterTest.php
rename to vendor/psy/psysh/test/TabCompletion/AutoCompleterTest.php
index 3f2fda901eb52f1182b8cf3321366d2675318554..262ef6d17bc6140257377b2df6cf16e383547dd7 100644 (file)
@@ -3,7 +3,7 @@
 /*
  * This file is part of Psy Shell.
  *
- * (c) 2012-2017 Justin Hileman
+ * (c) 2012-2018 Justin Hileman
  *
  * For the full copyright and license information, please view the LICENSE
  * file that was distributed with this source code.
@@ -21,21 +21,21 @@ use Psy\TabCompletion\Matcher;
 class AutoCompleterTest extends \PHPUnit\Framework\TestCase
 {
     /**
-     * @param $line
-     * @param $mustContain
-     * @param $mustNotContain
+     * @param string $line
+     * @param array  $mustContain
+     * @param array  $mustNotContain
      * @dataProvider classesInput
      */
     public function testClassesCompletion($line, $mustContain, $mustNotContain)
     {
         $context = new Context();
 
-        $commands = array(
+        $commands = [
             new ShowCommand(),
             new ListCommand(),
-        );
+        ];
 
-        $matchers = array(
+        $matchers = [
             new Matcher\VariablesMatcher(),
             new Matcher\ClassNamesMatcher(),
             new Matcher\ConstantsMatcher(),
@@ -46,7 +46,7 @@ class AutoCompleterTest extends \PHPUnit\Framework\TestCase
             new Matcher\ClassAttributesMatcher(),
             new Matcher\ClassMethodsMatcher(),
             new Matcher\CommandsMatcher($commands),
-        );
+        ];
 
         $config = new Configuration();
         $tabCompletion = $config->getAutoCompleter();
@@ -57,13 +57,13 @@ class AutoCompleterTest extends \PHPUnit\Framework\TestCase
             $tabCompletion->addMatcher($matcher);
         }
 
-        $context->setAll(array('foo' => 12, 'bar' => new \DOMDocument()));
+        $context->setAll(['foo' => 12, 'bar' => new \DOMDocument()]);
 
-        $code = $tabCompletion->processCallback('', 0, array(
+        $code = $tabCompletion->processCallback('', 0, [
            'line_buffer' => $line,
            'point'       => 0,
            'end'         => strlen($line),
-        ));
+        ]);
 
         foreach ($mustContain as $mc) {
             $this->assertContains($mc, $code);
@@ -92,54 +92,54 @@ class AutoCompleterTest extends \PHPUnit\Framework\TestCase
      */
     public function classesInput()
     {
-        return array(
+        return [
             // input, must had, must not had
-            array('T_OPE', array('T_OPEN_TAG'), array()),
-            array('st', array('stdClass'), array()),
-            array('stdCla', array('stdClass'), array()),
-            array('new s', array('stdClass'), array()),
-            array(
+            ['T_OPE', ['T_OPEN_TAG'], []],
+            ['st', ['stdClass'], []],
+            ['stdCla', ['stdClass'], []],
+            ['new s', ['stdClass'], []],
+            [
                 'new ',
-                array('stdClass', 'Psy\\Context', 'Psy\\Configuration'),
-                array('require', 'array_search', 'T_OPEN_TAG', '$foo'),
-            ),
-            array('new Psy\\C', array('Context'), array('CASE_LOWER')),
-            array('\s', array('stdClass'), array()),
-            array('array_', array('array_search', 'array_map', 'array_merge'), array()),
-            array('$bar->', array('load'), array()),
-            array('$b', array('bar'), array()),
-            array('6 + $b', array('bar'), array()),
-            array('$f', array('foo'), array()),
-            array('l', array('ls'), array()),
-            array('ls ', array(), array('ls')),
-            array('sho', array('show'), array()),
-            array('12 + clone $', array('foo'), array()),
+                ['stdClass', 'Psy\\Context', 'Psy\\Configuration'],
+                ['require', 'array_search', 'T_OPEN_TAG', '$foo'],
+            ],
+            ['new Psy\\C', ['Context'], ['CASE_LOWER']],
+            ['\s', ['stdClass'], []],
+            ['array_', ['array_search', 'array_map', 'array_merge'], []],
+            ['$bar->', ['load'], []],
+            ['$b', ['bar'], []],
+            ['6 + $b', ['bar'], []],
+            ['$f', ['foo'], []],
+            ['l', ['ls'], []],
+            ['ls ', [], ['ls']],
+            ['sho', ['show'], []],
+            ['12 + clone $', ['foo'], []],
             // array(
             //   '$foo ',
             //   array('+', 'clone'),
             //   array('$foo', 'DOMDocument', 'array_map')
             // ), requires a operator matcher?
-            array('$', array('foo', 'bar'), array('require', 'array_search', 'T_OPEN_TAG', 'Psy')),
-            array(
+            ['$', ['foo', 'bar'], ['require', 'array_search', 'T_OPEN_TAG', 'Psy']],
+            [
                 'Psy\\',
-                array('Context', 'TabCompletion\\Matcher\\AbstractMatcher'),
-                array('require', 'array_search'),
-            ),
-            array(
+                ['Context', 'TabCompletion\\Matcher\\AbstractMatcher'],
+                ['require', 'array_search'],
+            ],
+            [
                 'Psy\Test\TabCompletion\StaticSample::CO',
-                array('Psy\Test\TabCompletion\StaticSample::CONSTANT_VALUE'),
-                array(),
-            ),
-            array(
+                ['Psy\Test\TabCompletion\StaticSample::CONSTANT_VALUE'],
+                [],
+            ],
+            [
                 'Psy\Test\TabCompletion\StaticSample::',
-                array('Psy\Test\TabCompletion\StaticSample::$staticVariable'),
-                array(),
-            ),
-            array(
+                ['Psy\Test\TabCompletion\StaticSample::$staticVariable'],
+                [],
+            ],
+            [
                 'Psy\Test\TabCompletion\StaticSample::',
-                array('Psy\Test\TabCompletion\StaticSample::staticFunction'),
-                array(),
-            ),
-        );
+                ['Psy\Test\TabCompletion\StaticSample::staticFunction'],
+                [],
+            ],
+        ];
     }
 }