diff options
Diffstat (limited to 'vendor/phpunit/php-token-stream/tests/_fixture')
19 files changed, 245 insertions, 0 deletions
diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/classExtendsNamespacedClass.php b/vendor/phpunit/php-token-stream/tests/_fixture/classExtendsNamespacedClass.php new file mode 100644 index 0000000..560eec9 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/classExtendsNamespacedClass.php @@ -0,0 +1,10 @@ +<?php + +namespace Foo\Bar; + +class Baz {} + +namespace Other\Space; + +class Extender extends \Foo\Bar\Baz {} + diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/classInNamespace.php b/vendor/phpunit/php-token-stream/tests/_fixture/classInNamespace.php new file mode 100644 index 0000000..8ade7cd --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/classInNamespace.php @@ -0,0 +1,6 @@ +<?php +namespace Foo\Bar; + +class TestClass +{ +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/classInScopedNamespace.php b/vendor/phpunit/php-token-stream/tests/_fixture/classInScopedNamespace.php new file mode 100644 index 0000000..1ba475c --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/classInScopedNamespace.php @@ -0,0 +1,9 @@ +<?php +namespace Foo\BarScoped { + + class TestClass { + + } + +} + diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/classUsesNamespacedFunction.php b/vendor/phpunit/php-token-stream/tests/_fixture/classUsesNamespacedFunction.php new file mode 100644 index 0000000..5e08a12 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/classUsesNamespacedFunction.php @@ -0,0 +1,8 @@ +<?php +namespace foo; + +use function bar\baz; + +class Foo +{ +}
\ No newline at end of file diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/class_with_method_named_empty.php b/vendor/phpunit/php-token-stream/tests/_fixture/class_with_method_named_empty.php new file mode 100644 index 0000000..1dafc18 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/class_with_method_named_empty.php @@ -0,0 +1,7 @@ +<?php +class class_with_method_named_empty +{ + public function empty(): void + { + } +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/class_with_method_that_declares_anonymous_class.php b/vendor/phpunit/php-token-stream/tests/_fixture/class_with_method_that_declares_anonymous_class.php new file mode 100644 index 0000000..4a02fe1 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/class_with_method_that_declares_anonymous_class.php @@ -0,0 +1,15 @@ +<?php +interface foo { +} + +class class_with_method_that_declares_anonymous_class +{ + public function method() + { + $o = new class { public function foo() {} }; + $o = new class{public function foo(){}}; + $o = new class extends stdClass {}; + $o = new class extends stdClass {}; + $o = new class implements foo {}; + } +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/class_with_method_that_declares_anonymous_class2.php b/vendor/phpunit/php-token-stream/tests/_fixture/class_with_method_that_declares_anonymous_class2.php new file mode 100644 index 0000000..9f3ee28 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/class_with_method_that_declares_anonymous_class2.php @@ -0,0 +1,16 @@ +<?php +class Test { + public function methodOne() { + $foo = new class { + public function method_in_anonymous_class() { + return true; + } + }; + + return $foo->method_in_anonymous_class(); + } + + public function methodTwo() { + return false; + } +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/class_with_multiple_anonymous_classes_and_functions.php b/vendor/phpunit/php-token-stream/tests/_fixture/class_with_multiple_anonymous_classes_and_functions.php new file mode 100644 index 0000000..3267ba5 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/class_with_multiple_anonymous_classes_and_functions.php @@ -0,0 +1,26 @@ +<?php +class class_with_multiple_anonymous_classes_and_functions +{ + public function m() + { + $c = new class { + public function n() { + return true; + } + }; + + $d = new class { + public function o() { + return false; + } + }; + + $f = function ($a, $b) { + return $a + $b; + }; + + $g = function ($a, $b) { + return $a - $b; + }; + } +}
\ No newline at end of file diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/closure.php b/vendor/phpunit/php-token-stream/tests/_fixture/closure.php new file mode 100644 index 0000000..a0e3a81 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/closure.php @@ -0,0 +1,7 @@ +<?php +$function1 = function($foo, $bar) use ($var) {}; +$function2 = function(Foo $foo, $bar) use ($var) {}; +$function3 = function ($foo, $bar, $baz) {}; +$function4 = function (Foo $foo, $bar, $baz) {}; +$function5 = function () {}; +$function6 = function() {}; diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/issue19.php b/vendor/phpunit/php-token-stream/tests/_fixture/issue19.php new file mode 100644 index 0000000..91eeb47 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/issue19.php @@ -0,0 +1,3 @@ +<?php +class TestClass { +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/issue30.php b/vendor/phpunit/php-token-stream/tests/_fixture/issue30.php new file mode 100644 index 0000000..0d1f6f3 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/issue30.php @@ -0,0 +1,8 @@ +<?php +class Foo +{ + public function bar() + { + return Foo::CLASS; + } +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/multipleNamespacesWithOneClassUsingBraces.php b/vendor/phpunit/php-token-stream/tests/_fixture/multipleNamespacesWithOneClassUsingBraces.php new file mode 100644 index 0000000..d3a12e3 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/multipleNamespacesWithOneClassUsingBraces.php @@ -0,0 +1,12 @@ +<?php +namespace Foo\Bar; + +class TestClassInBar +{ +} + +namespace Foo\Baz; + +class TestClassInBaz +{ +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/multipleNamespacesWithOneClassUsingNonBraceSyntax.php b/vendor/phpunit/php-token-stream/tests/_fixture/multipleNamespacesWithOneClassUsingNonBraceSyntax.php new file mode 100644 index 0000000..4ee4f24 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/multipleNamespacesWithOneClassUsingNonBraceSyntax.php @@ -0,0 +1,14 @@ +<?php +namespace Foo\Bar +{ + class TestClassInBar + { + } +} + +namespace Foo\Baz +{ + class TestClassInBaz + { + } +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/php-code-coverage-issue-424.php b/vendor/phpunit/php-token-stream/tests/_fixture/php-code-coverage-issue-424.php new file mode 100644 index 0000000..457e0bb --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/php-code-coverage-issue-424.php @@ -0,0 +1,13 @@ +<?php + +class Example +{ + public function even($numbers) + { + $numbers = array_filter($numbers, function($number) { + return $number % 2 === 0; + }); + + return array_merge($numbers); + } +}
\ No newline at end of file diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/source.php b/vendor/phpunit/php-token-stream/tests/_fixture/source.php new file mode 100644 index 0000000..0c9b87f --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/source.php @@ -0,0 +1,36 @@ +<?php +/** + * Some comment + */ +class Foo{function foo(){} + + /** + * @param Baz $baz + */ + public function bar(Baz $baz) + { + } + + /** + * @param Foobar $foobar + */ + static public function foobar(Foobar $foobar) + { + } + + public function barfoo(Barfoo $barfoo) + { + } + + /** + * This docblock does not belong to the baz function + */ + + public function baz() + { + } + + public function blaz($x, $y) + { + } +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/source2.php b/vendor/phpunit/php-token-stream/tests/_fixture/source2.php new file mode 100644 index 0000000..b33dce1 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/source2.php @@ -0,0 +1,6 @@ +<?php +// short desc +abstract class A { + /* abst meth: */ + public static abstract function method(); +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/source3.php b/vendor/phpunit/php-token-stream/tests/_fixture/source3.php new file mode 100644 index 0000000..7e42b60 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/source3.php @@ -0,0 +1,14 @@ +<?php +// This file is example#1 +// from http://www.php.net/manual/en/function.get-included-files.php + +include 'test1.php'; +include_once 'test2.php'; +require 'test3.php'; +require_once 'test4.php'; + +$included_files = get_included_files(); + +foreach ($included_files as $filename) { + echo "$filename\n"; +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/source4.php b/vendor/phpunit/php-token-stream/tests/_fixture/source4.php new file mode 100644 index 0000000..6b064fc --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/source4.php @@ -0,0 +1,30 @@ +<?php +// Declare the interface 'iTemplate' +interface iTemplate +{ + public function setVariable($name, $var); + public function + getHtml($template); +} + +interface a +{ + public function foo(); +} + +interface b extends a +{ + public function baz(Baz $baz); +} + +// short desc for class that implement a unique interface +class c implements b +{ + public function foo() + { + } + + public function baz(Baz $baz) + { + } +} diff --git a/vendor/phpunit/php-token-stream/tests/_fixture/source5.php b/vendor/phpunit/php-token-stream/tests/_fixture/source5.php new file mode 100644 index 0000000..ef7d474 --- /dev/null +++ b/vendor/phpunit/php-token-stream/tests/_fixture/source5.php @@ -0,0 +1,5 @@ +<?php +function foo($a, array $b, array $c = array()) {} +interface i { public function m($a, array $b, array $c = array()); } +abstract class a { abstract public function m($a, array $b, array $c = array()); } +class c { public function m($a, array $b, array $c = array()) {} } |