[FORMAT] Run php-cs-fixer on tests/

This commit is contained in:
Diogo Cordeiro
2020-06-24 13:08:11 +01:00
committed by Diogo Peralta Cordeiro
parent bba9c0d560
commit 81d50c4ec3
19 changed files with 1026 additions and 1024 deletions

View File

@@ -31,6 +31,7 @@ final class CallableLeftCurryTest extends TestCase
{
/**
* @dataProvider provider
*
* @param $callback_test
* @param $curry_params
* @param $call_params
@@ -41,42 +42,42 @@ final class CallableLeftCurryTest extends TestCase
$params = array_merge([$callback_test], $curry_params);
$curried = call_user_func_array('callableLeftCurry', $params);
$result = call_user_func_array($curried, $call_params);
$this->assertEquals($expected, $result);
static::assertSame($expected, $result);
}
static public function provider()
public static function provider()
{
$obj = new CurryTestHelperObj('oldval');
return [[['Tests\Unit\CallableLeftCurryTest', 'callback_test'],
['curried'],
['called'],
'called|curried'],
'called|curried',],
[['Tests\Unit\CallableLeftCurryTest', 'callback_test'],
['curried1', 'curried2'],
['called1', 'called2'],
'called1|called2|curried1|curried2'],
'called1|called2|curried1|curried2',],
[['Tests\Unit\CallableLeftCurryTest', 'callback_testObj'],
[$obj],
['newval1'],
'oldval|newval1'],
'oldval|newval1',],
// Confirm object identity is retained...
[['Tests\Unit\CallableLeftCurryTest', 'callback_testObj'],
[$obj],
['newval2'],
'newval1|newval2']];
'newval1|newval2',],];
}
static function callback_test()
public static function callback_test()
{
$args = func_get_args();
return implode("|", $args);
return implode('|', $args);
}
static function callback_testObj($val, $obj)
public static function callback_testObj($val, $obj)
{
$old = $obj->val;
$obj->val = $val;
return "$old|$val";
return "{$old}|{$val}";
}
}
@@ -84,7 +85,7 @@ class CurryTestHelperObj
{
public $val = '';
function __construct($val)
public function __construct($val)
{
$this->val = $val;
}