Use EXPECT instead of EXPECTF when possible

EXPECTF logic in run-tests.php is considerable, so let's avoid it.
This commit is contained in:
Gabriel Caruso 2018-02-19 05:59:41 -03:00 committed by Nikita Popov
parent a00286921e
commit ded3d984c6
2790 changed files with 2744 additions and 2744 deletions

View File

@ -41,7 +41,7 @@ var_dump(get_parent_class(1));
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
bool(false)
bool(false)
string(3) "foo"

View File

@ -862,7 +862,7 @@ try {
}
?>
--EXPECTF--
--EXPECT--
This exception severity is: 1bool(true)
bool(true)
bool(true)

View File

@ -8,6 +8,6 @@ abstract class TestClass
}
?>
===DONE===
--EXPECTF--
--EXPECT--
===DONE===

View File

@ -32,7 +32,7 @@ echo $a->func1(),"\n";
echo $a->func2(),"\n";
?>
--EXPECTF--
--EXPECT--
var1 value
var2 value
in func1

View File

@ -15,7 +15,7 @@ call_user_func(array($c, 'none'));
call_user_func(array($c, 'prot'));
call_user_func(array($c, 'priv'));
?>
--EXPECTF--
--EXPECT--
In __call() for method none()
In __call() for method prot()
In __call() for method priv()

View File

@ -29,7 +29,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
array(3) {
[0]=>
int(1)

View File

@ -16,7 +16,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
float(2834756759.1231)
float(2834756759.1231)
Done

View File

@ -30,7 +30,7 @@ var_dump($s);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(3) "020"
string(4) "pead"
string(4) "pead"

View File

@ -15,7 +15,7 @@ $a = new class extends A implements B {
};
var_dump($a instanceof A, $a instanceof B);
--EXPECTF--
--EXPECT--
bool(true)
bool(true)

View File

@ -10,6 +10,6 @@ $foo = function() {
$closure = Closure::bind($foo, $class, $class);
var_dump($closure());
?>
--EXPECTF--
--EXPECT--
object(class@anonymous)#1 (0) {
}

View File

@ -12,5 +12,5 @@ $class = new class() {
};
var_dump($class->run());
?>
--EXPECTF--
--EXPECT--
string(10) "Running..."

View File

@ -50,7 +50,7 @@ test2($a, $b, $c, $d, ...$array);
var_dump($a, $b, $c, $d, $array);
?>
--EXPECTF--
--EXPECT--
array(3) {
[0]=>
int(2)

View File

@ -19,6 +19,6 @@ try {
}
?>
--EXPECTF--
--EXPECT--
string(36) "Cannot unpack array with string keys"
string(42) "Cannot unpack Traversable with string keys"

View File

@ -14,4 +14,4 @@ class Sub extends Base {
}
}
?>
--EXPECTF--
--EXPECT--

View File

@ -8,5 +8,5 @@ assert.exception=1
assert(true);
var_dump(true);
?>
--EXPECTF--
--EXPECT--
bool(true)

View File

@ -12,7 +12,7 @@ var_dump(\assert(true));
var_dump(assert(false));
var_dump(assert(true));
?>
--EXPECTF--
--EXPECT--
bool(true)
bool(true)
bool(true)

View File

@ -12,7 +12,7 @@ var_dump($var1);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
int(2)
int(2)
Done

View File

@ -12,7 +12,7 @@ var_dump($var1);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(1) "g"
string(1) "g"
Done

View File

@ -12,7 +12,7 @@ var_dump($var1);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
NULL
NULL
Done

View File

@ -15,7 +15,7 @@ var_dump($var2);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(5) "space"
string(5) "space"
string(5) "space"

View File

@ -13,7 +13,7 @@ for ($i = 0; $i < 8; $i++) {
$h =& f();
}
?>
--EXPECTF--
--EXPECT--
string(3) "foo"
'foo'
string(3) "foo"

View File

@ -24,6 +24,6 @@ catch(Exception $e)
}
?>
===DONE===
--EXPECTF--
--EXPECT--
Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator
===DONE===

View File

@ -13,7 +13,7 @@ var_dump(class_exists('NotExistingClass'));
?>
===DONE===
--EXPECTF--
--EXPECT--
{closure}(NotExistingClass)
bool(false)
{closure}(NotExistingClass), done

View File

@ -45,7 +45,7 @@ var_dump(ClassC::$prop);
?>
===DONE===
--EXPECTF--
--EXPECT--
===INIT===
string(1) "A"
string(1) "C"

View File

@ -89,7 +89,7 @@ if (is_callable(array('test_class','test_func4'))) {
$object = new foo();
$object->test();
?>
--EXPECTF--
--EXPECT--
test_func1
test_func2
test_func3

View File

@ -28,7 +28,7 @@ unset($bar);
?>
===DONE===
--EXPECTF--
--EXPECT--
Foo::__construct
Caught exception!
===DONE===

View File

@ -96,7 +96,7 @@ var_dump($x->doSomethingStatic(1));
?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
--EXPECT--
===A===
TestB::doSomething(1)
TestA::doSomething(2)

View File

@ -33,7 +33,7 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
int(32767)
int(32767)
int(30719)

View File

@ -14,5 +14,5 @@ set_exception_handler("ehandle::exh");
throw new Exception ("Whiii");
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
foo

View File

@ -20,7 +20,7 @@ try_class::main ();
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
Done
Warning: (Registered shutdown functions) Unable to call self::on_shutdown() - function does not exist in Unknown on line 0

View File

@ -26,6 +26,6 @@ try {
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(40) "Creating default object from empty value"
Done

View File

@ -6,5 +6,5 @@ declare(ticks=1);
namespace test;
echo "ok\n";
?>
--EXPECTF--
--EXPECT--
ok

View File

@ -21,5 +21,5 @@ $o = new C();
$o->foo();
?>
--EXPECTF--
--EXPECT--
works

View File

@ -23,7 +23,7 @@ function myErrorHandler($errno, $errstr, $errfile, $errline)
?>
===DONE===
--EXPECTF--
--EXPECT--
*** Testing restore_error_handler() : error bug #46196 ***
NULL
bool(true)

View File

@ -7,7 +7,7 @@ arg_separator.output=&
var_dump(ini_set("arg_separator.output", ""));
var_dump(ini_get("arg_separator.output"));
?>
--EXPECTF--
--EXPECT--
bool(false)
string(1) "&"

View File

@ -22,5 +22,5 @@ $a = new A();
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
Done

View File

@ -13,5 +13,5 @@ interface a{}
class b implements a { function f($a=1) {}}
class c extends b {function f() {}}
?>
--EXPECTF--
--EXPECT--
string(60) "Declaration of c::f() should be compatible with b::f($a = 1)"

View File

@ -28,7 +28,7 @@ $b = new B();
$b->A();
?>
===DONE===
--EXPECTF--
--EXPECT--
B::__construct
A::__construct
B::A

View File

@ -49,5 +49,5 @@ $c = new C;
$c->func('This should work!');
?>
--EXPECTF--
--EXPECT--
string(26) "A::func: This should work!"

View File

@ -6,5 +6,5 @@ $d = 2.2250738585072011e-308;
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
Done

View File

@ -30,7 +30,7 @@ $o= myHelloWorld::getInstance(array(1=>2));
$o= myHelloWorld::getInstance(array(1=>2));
?>
--EXPECTF--
--EXPECT--
int(1)
int(2)
array(1) {

View File

@ -22,5 +22,5 @@ eval('
echo "DONE\n";
?>
--EXPECTF--
--EXPECT--
DONE

View File

@ -26,7 +26,7 @@ namespace foo {
}
?>
--EXPECTF--
--EXPECT--
bool(false)
string(12) "/** test1 */"
string(12) "/** test2 */"

View File

@ -4,5 +4,5 @@ Bug #55445 (Lexer error with short open tags)
short_open_tag=0
--FILE--
<?php $u = "chris"; ?><p>Welcome <?= $u ?></p>
--EXPECTF--
--EXPECT--
<p>Welcome chris</p>

View File

@ -28,7 +28,7 @@ class Notice extends Base {
}
echo "POST-CLASS-GUARD2\n";
?>
--EXPECTF--
--EXPECT--
PRE-CLASS-GUARD
POST-CLASS-GUARD
POST-CLASS-GUARD2

View File

@ -27,7 +27,7 @@ class Notice extends Base {
}
echo "POST-CLASS-GUARD2\n";
?>
--EXPECTF--
--EXPECT--
PRE-CLASS-GUARD
POST-CLASS-GUARD
POST-CLASS-GUARD2

View File

@ -15,5 +15,5 @@ class B extends A
?>
==DONE==
--EXPECTF--
--EXPECT--
==DONE==

View File

@ -16,6 +16,6 @@ $class = new \ReflectionClass('myClass');
var_dump($class->getTraitAliases());
?>
--EXPECTF--
--EXPECT--
array(0) {
}

View File

@ -21,5 +21,5 @@ $matches[2] = $dummy;
str_replace("foo", "bar", "foobar", $matches);
echo "okey";
?>
--EXPECTF--
--EXPECT--
okey

View File

@ -10,6 +10,6 @@ $test = new Test();
var_dump(isset($test->protectedProperty));
var_dump(isset($test->protectedProperty->foo));
--EXPECTF--
--EXPECT--
bool(false)
bool(false)

View File

@ -20,5 +20,5 @@ try {
var_dump($e->getMessage());
}
?>
--EXPECTF--
--EXPECT--
string(9) "serialize"

View File

@ -9,6 +9,6 @@ function x($s) { $s['a'] = 1; };
$y = '1';
x($y);
print_r($y);
--EXPECTF--
--EXPECT--
string(25) "Illegal string offset 'a'"
1

View File

@ -18,6 +18,6 @@ class ghi
ghi::def();
?>
--EXPECTF--
--EXPECT--
ghi
ghi

View File

@ -25,7 +25,7 @@ $test = new Test();
?>
===DONE===
--EXPECTF--
--EXPECT--
array (
1 => 'first',
2 => 'second',

View File

@ -16,6 +16,6 @@ foreach ($fcts as $fct) {
}
?>
Done
--EXPECTF--
--EXPECT--
dl Ok
Done

View File

@ -8,5 +8,5 @@ class FooBar {
const bar = ["bar" => 3]["bar"];
}
echo "okey";
--EXPECTF--
--EXPECT--
okey

View File

@ -20,5 +20,5 @@ unset($gen1);
foreach ($gen2 as $v) { var_dump($v); }
?>
--EXPECTF--
--EXPECT--
int(1)

View File

@ -25,7 +25,7 @@ class C10 implements ArrayAccess
$c10 = new C10;
var_dump($c10[] += 5);
--EXPECTF--
--EXPECT--
Inside C10::offsetGet
NULL

View File

@ -30,7 +30,7 @@ try {
var_dump($e->getMessage());
}
?>
--EXPECTF--
--EXPECT--
string(36) "Cannot use string offset as an array"
string(27) "Cannot unset string offsets"
string(41) "Only variables can be passed by reference"

View File

@ -11,5 +11,5 @@ $bar = function () {
var_dump($bar->call(new foo));
?>
--EXPECTF--
--EXPECT--
string(3) "foo"

View File

@ -20,7 +20,7 @@ function c ($option) {
}
a(array('bla' => 'false'));
?>
--EXPECTF--
--EXPECT--
array(1) {
["bla"]=>
string(7) "changed"

View File

@ -22,7 +22,7 @@ var_dump(get_object_vars($oldFoo));
$newFoo->bing($oldFoo);
?>
--EXPECTF--
--EXPECT--
array(1) {
[0]=>
string(4) "bing"

View File

@ -25,5 +25,5 @@ function traverse($a) {
$arr = array(1 => 'foo', 'b' => 'bar', 'baz');
var_dump(traverse($arr));
?>
--EXPECTF--
--EXPECT--
string(3) "baz"

View File

@ -8,5 +8,5 @@ echo 200000000000000000000000000000000000000000000000000000000000000000000000000
echo -200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
?>
--EXPECTF--
--EXPECT--
INF-INF

View File

@ -19,7 +19,7 @@ call_user_func(array($a, 'aAa'));
call_user_func(array('Foo', 'aAa'));
?>
--EXPECTF--
--EXPECT--
nonstatic
string(3) "aAa"
static

View File

@ -36,7 +36,7 @@ foreach ($vars as $var) {
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
bool(true)
bool(true)
bool(false)

View File

@ -26,7 +26,7 @@ baz::test();
bar::test();
?>
--EXPECTF--
--EXPECT--
foo
baz
foo

View File

@ -27,7 +27,7 @@ unlink($filename);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
int(1)
int(5)
Done

View File

@ -51,7 +51,7 @@ namespace {
}
?>
--EXPECTF--
--EXPECT--
In NS
string(11) "Foo\Bar\Moo"
Top

View File

@ -9,5 +9,5 @@ class Foo {
}
echo (new Foo)->bar;
?>
--EXPECTF--
--EXPECT--
3

View File

@ -18,7 +18,7 @@ echo $cc(10)."\n";
echo "Done.\n";
?>
--EXPECTF--
--EXPECT--
11
11
12

View File

@ -27,7 +27,7 @@ var_dump($cb());
var_dump($cb2());
?>
--EXPECTF--
--EXPECT--
int(1)
int(11)
int(12)

View File

@ -37,7 +37,7 @@ $closure = $b->getClosure();
$closure();
?>
Done.
--EXPECTF--
--EXPECT--
1
42
42

View File

@ -39,7 +39,7 @@ $d = $nonstaticScoped->bindTo(new A, 'A'); $d(); echo "\n";
echo "Done.\n";
--EXPECTF--
--EXPECT--
Before binding
bool(false)
bool(false)

View File

@ -14,5 +14,5 @@ $a->bindTo(new A);
echo "Done.\n";
--EXPECTF--
--EXPECT--
Done.

View File

@ -39,7 +39,7 @@ $d = $nonstaticScoped->bindTo(new B, "static"); $d(); echo "\n";
echo "Done.\n";
--EXPECTF--
--EXPECT--
Before binding
bool(false)
bool(false)

View File

@ -35,7 +35,7 @@ foreach ($callables as $callable) {
}
?>
--EXPECTF--
--EXPECT--
Bar
int
Bar

View File

@ -48,7 +48,7 @@ foreach($a as $var) {
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3)} === array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3)}
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3)} !== string(0) ""
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3)} !== int(1)

View File

@ -38,7 +38,7 @@ try{
$n = "-1";
$n %= $n;
var_dump($n);
--EXPECTF--
--EXPECT--
int(0)
Exception: Bit shift by negative number

View File

@ -12,6 +12,6 @@ foo();
}
?>
--EXPECTF--
--EXPECT--
tick
tick

View File

@ -25,7 +25,7 @@ var_dump($c);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
float(394758.39454545)
float(394758.39454545)
float(394758.39454545)

View File

@ -35,7 +35,7 @@ foreach ($doubles as $d) {
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(7) "2.9E+37"
string(18) "290000000000000000"
string(15) "290000000000000"

View File

@ -54,7 +54,7 @@ var_dump(empty($str[$f]));
print "done\n";
?>
--EXPECTF--
--EXPECT--
- empty ---
bool(false)
bool(true)

View File

@ -13,5 +13,5 @@ class test extends test1 {
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
Done

View File

@ -9,7 +9,7 @@ class test {
var_dump(test::TEST);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
array(3) {
[0]=>
int(1)

View File

@ -25,6 +25,6 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
int(32767)
Done

View File

@ -25,6 +25,6 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
int(32767)
Done

View File

@ -29,7 +29,7 @@ var_dump(error_reporting());
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
int(32767)
int(32759)
Done

View File

@ -16,5 +16,5 @@ throw new test();
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(12) "test thrown!"

View File

@ -20,5 +20,5 @@ throw new Exception();
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(17) "Exception thrown!"

View File

@ -19,5 +19,5 @@ throw new excEption();
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(25) "foo1(): Exception thrown!"

View File

@ -21,5 +21,5 @@ throw new excEption();
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
string(24) "foo(): Exception thrown!"

View File

@ -14,7 +14,7 @@ foreach($array as list(, $a)) {
}
?>
--EXPECTF--
--EXPECT--
int(1)
int(3)
string(1) "b"

View File

@ -16,7 +16,7 @@ var_dump($a);
var_dump(array_reverse($array));
?>
--EXPECTF--
--EXPECT--
array(4) {
[0]=>
string(1) "a"

View File

@ -11,7 +11,7 @@ foreach ($arr as $key => $val) {
var_dump($arr);
echo "Done\n";
?>
--EXPECTF--
--EXPECT--
array(2) {
["a"]=>
int(1)

View File

@ -7,5 +7,5 @@ zend.enable_gc=0
gc_collect_cycles();
echo "DONE\n";
?>
--EXPECTF--
--EXPECT--
DONE

View File

@ -15,7 +15,7 @@ foreach (a(range(1, 3)) as $a) {
var_dump($a);
}
?>
--EXPECTF--
--EXPECT--
int(1)
int(2)
int(3)

View File

@ -27,7 +27,7 @@ $gen = gen();
$gen->rewind(); // force run
?>
--EXPECTF--
--EXPECT--
before return
before return in inner finally
outer finally run

View File

@ -68,7 +68,7 @@ $gen = gen6();
var_dump($gen->getReturn());
?>
--EXPECTF--
--EXPECT--
int(42)
int(24)
int(42)

View File

@ -26,7 +26,7 @@ var_dump(get_class_methods('Y'));
Y::test();
?>
--EXPECTF--
--EXPECT--
array(1) {
[0]=>
string(1) "a"

Some files were not shown because too many files have changed in this diff Show More