N°2651 rollback gitignore for lib tests dirs

Too dangerous ! We'll work properly on this but for 2.8
This commit is contained in:
Pierre Goiffon
2020-01-10 15:15:15 +01:00
parent 881fc2a1de
commit ad821e7d9c
2086 changed files with 151849 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
Aliases (namespacing)
-----
<?php
use A\B;
use C\D as E;
use F\G as H, J;
use function foo\bar;
use function foo\bar as baz;
use const foo\BAR;
use const foo\BAR as BAZ;
-----
use A\B;
use C\D as E;
use F\G as H, J;
use function foo\bar;
use function foo\bar as baz;
use const foo\BAR;
use const foo\BAR as BAZ;

View File

@@ -0,0 +1,13 @@
break/continue
-----
<?php
continue;
continue 2;
break;
break 2;
-----
continue;
continue 2;
break;
break 2;

View File

@@ -0,0 +1,53 @@
Class
-----
<?php
class Foo extends Bar implements ABC, \DEF, namespace\GHI
{
var $a = 'foo';
private $b = 'bar';
static $c = 'baz';
function test()
{
$this->a = 'bar';
echo 'test';
}
protected function baz() {}
public function foo() {}
abstract static function bar() {}
}
trait Bar
{
function test()
{
}
}
-----
class Foo extends Bar implements ABC, \DEF, namespace\GHI
{
var $a = 'foo';
private $b = 'bar';
static $c = 'baz';
function test()
{
$this->a = 'bar';
echo 'test';
}
protected function baz()
{
}
public function foo()
{
}
static abstract function bar()
{
}
}
trait Bar
{
function test()
{
}
}

View File

@@ -0,0 +1,20 @@
Class constants
-----
<?php
class Foo
{
const A = 1, B = 2;
public const C = 3, D = 4;
protected const E = 5, F = 6;
private const G = 7, H = 8;
}
-----
!!php7
class Foo
{
const A = 1, B = 2;
public const C = 3, D = 4;
protected const E = 5, F = 6;
private const G = 7, H = 8;
}

View File

@@ -0,0 +1,11 @@
Constant declarations
-----
<?php
const FOO = 'BAR';
const FOO = 1 + 1;
const FOO = BAR, BAR = FOO;
-----
const FOO = 'BAR';
const FOO = 1 + 1;
const FOO = BAR, BAR = FOO;

View File

@@ -0,0 +1,17 @@
declare
-----
<?php
declare (strict_types=1);
declare (ticks=1) {
foo();
}
declare (ticks=2) {
}
-----
declare (strict_types=1);
declare (ticks=1) {
foo();
}
declare (ticks=2) {
}

View File

@@ -0,0 +1,10 @@
doWhile
-----
<?php
do {
} while (true);
-----
do {
} while (true);

View File

@@ -0,0 +1,28 @@
for
-----
<?php
for ($i = 0; $i < 10; $i++) {
}
for ($i = 0,$j = 0; $i < 10; $i++) {
}
for ($i = 0; $i < 10;) {
}
for (;;) {
}
-----
for ($i = 0; $i < 10; $i++) {
}
for ($i = 0, $j = 0; $i < 10; $i++) {
}
for ($i = 0; $i < 10;) {
}
for (;;) {
}

View File

@@ -0,0 +1,28 @@
foreach
-----
<?php
foreach ($arr as $val) {
}
foreach ($arr as &$val) {
}
foreach ($arr as $key => $val) {
}
foreach ($arr as $key => &$val) {
}
-----
foreach ($arr as $val) {
}
foreach ($arr as &$val) {
}
foreach ($arr as $key => $val) {
}
foreach ($arr as $key => &$val) {
}

View File

@@ -0,0 +1,43 @@
Function signatures
-----
<?php
interface A
{
function f1();
function f2($a, $b);
function f3(&$a);
function f4(A\B $a);
function f4(array $a);
function f5(callable $a);
function f6(&$a);
function f7(...$a);
function f8(&...$a);
function f9(A &$a);
function f10(A ...$a);
function f11(A &$a);
function f12(A &...$a);
function f13($a) : array;
function f14($a) : callable;
function f15($a) : B\C;
}
-----
interface A
{
function f1();
function f2($a, $b);
function f3(&$a);
function f4(A\B $a);
function f4(array $a);
function f5(callable $a);
function f6(&$a);
function f7(...$a);
function f8(&...$a);
function f9(A &$a);
function f10(A ...$a);
function f11(A &$a);
function f12(A &...$a);
function f13($a) : array;
function f14($a) : callable;
function f15($a) : B\C;
}

View File

@@ -0,0 +1,11 @@
Global and static variables
-----
<?php
global $a, $$a, ${$a[$a]};
static $a, $b;
static $a = 'foo', $b = 'bar';
-----
global $a, ${$a}, ${$a[$a]};
static $a, $b;
static $a = 'foo', $b = 'bar';

View File

@@ -0,0 +1,9 @@
goto
-----
<?php
marker:
goto marker;
-----
marker:
goto marker;

View File

@@ -0,0 +1,16 @@
Group use declaration
-----
<?php
use A\{B};
use A\{B\C, D};
use A\B\{C\D, E};
use function A\{b\c, d};
use const A\{B\C, D};
use A\B\{C\D, function b\c, const D};
-----
use A\{B};
use A\{B\C, D};
use A\B\{C\D, E};
use function A\{b\c, d};
use const A\{B\C, D};
use A\B\{C\D, function b\c, const D};

View File

@@ -0,0 +1,27 @@
__halt_compiler
-----
<?php
echo 'foo';
__halt_compiler();
!!!
???
-----
<?php
echo 'foo';
__halt_compiler();
!!!
???
-----
<?php
echo 'foo';
__halt_compiler();
<?php
-----
<?php
echo 'foo';
__halt_compiler();
<?php

View File

@@ -0,0 +1,16 @@
if/elseif/else
-----
<?php
if ($expr) {
} elseif ($expr2) {
} else {
}
-----
if ($expr) {
} elseif ($expr2) {
} else {
}

View File

@@ -0,0 +1,19 @@
Multi catch
-----
<?php
try {
$x;
} catch (X|Y $e1) {
$y;
} catch (\A|B\C $e2) {
$z;
}
-----
!!php7
try {
$x;
} catch (X|Y $e1) {
$y;
} catch (\A|B\C $e2) {
$z;
}

View File

@@ -0,0 +1,50 @@
Namespaces
-----
<?php
namespace Foo;
function foo()
{
}
namespace Bar;
function bar()
{
}
-----
namespace Foo;
function foo()
{
}
namespace Bar;
function bar()
{
}
-----
<?php
namespace Foo {
function foo()
{
}
}
namespace {
function glob() {
}
}
-----
namespace Foo {
function foo()
{
}
}
namespace {
function glob()
{
}
}

View File

@@ -0,0 +1,11 @@
Nullable types
-----
<?php
function test(?Foo $bar, ?string $foo, ?\Xyz $zyx) : ?Baz
{
}
-----
!!php7
function test(?Foo $bar, ?string $foo, ?\Xyz $zyx) : ?Baz
{
}

View File

@@ -0,0 +1,37 @@
switch/case/default
-----
<?php
switch ($expr) {
case 0:
echo 'First case, with a break';
break;
case 1:
echo 'Second case, which falls through';
case 2:
case 3:
case 4:
echo 'Third case, return instead of break';
return;
// Comment
default:
echo 'Default case';
break;
}
-----
switch ($expr) {
case 0:
echo 'First case, with a break';
break;
case 1:
echo 'Second case, which falls through';
case 2:
case 3:
case 4:
echo 'Third case, return instead of break';
return;
// Comment
default:
echo 'Default case';
break;
}

View File

@@ -0,0 +1,7 @@
throw
-----
<?php
throw $e;
-----
throw $e;

View File

@@ -0,0 +1,25 @@
Trait uses and adaptations
-----
<?php
class A
{
use B, C, D {
f as g;
f as private;
f as private g;
B::f as g;
B::f insteadof C, D;
}
}
-----
class A
{
use B, C, D {
f as g;
f as private;
f as private g;
B::f as g;
B::f insteadof C, D;
}
}

View File

@@ -0,0 +1,24 @@
tryCatch
-----
<?php
try {
} catch (Exception $e) {
}
try {
} catch (Exception $e) {
} finally {
}
-----
try {
} catch (Exception $e) {
}
try {
} catch (Exception $e) {
} finally {
}

View File

@@ -0,0 +1,10 @@
while
-----
<?php
while (true) {
}
-----
while (true) {
}