Skip to content
This repository was archived by the owner on Feb 21, 2019. It is now read-only.

Commit 08328bb

Browse files
committed
tests: added info
1 parent 7ff5c07 commit 08328bb

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

tests/Reflection/Parameter.defaultValues.phpt

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ use Nette\Reflection,
1111
require __DIR__ . '/../bootstrap.php';
1212

1313

14-
function check($method, $args)
14+
function check($name, $args)
1515
{
16-
$method = new Reflection\Method($method);
16+
$method = new Reflection\Method($name);
1717
foreach ($method->getParameters() as $param) {
18-
echo "{$method->getName()}(\${$param->getName()})\n";
18+
echo "$name(\${$param->getName()})\n";
1919
list($isOptional, $isDefaultValueAvailable, $defaultValue) = array_shift($args) + array(NULL, NULL, NULL);
2020
Assert::same( $isOptional, $param->isOptional() );
2121
Assert::same( $isDefaultValueAvailable, $param->isDefaultValueAvailable() );
@@ -40,7 +40,7 @@ class Test
4040

4141

4242
check( 'Test::func1', array(
43-
/* $a */ array(FALSE, FALSE),
43+
/* $a */ array(FALSE, FALSE), // isOptional | isDefaultValueAvailable | [ getDefaultValue ]
4444
/* $b */ array(FALSE, FALSE),
4545
/* $c */ array(FALSE, FALSE)
4646
));
@@ -83,3 +83,19 @@ check( 'FilesystemIterator::__construct', array(
8383
/* $path */ array(FALSE, FALSE),
8484
/* $flags */ array(TRUE, FALSE),
8585
));
86+
/*
87+
check( 'PDO::__construct', array(
88+
/* $dsn * / array(FALSE, FALSE),
89+
/* $username * / array(PHP_VERSION_ID >= 50426 && (PHP_VERSION_ID < 50500 || PHP_VERSION_ID > 50509), FALSE),
90+
/* $passwd * / array(PHP_VERSION_ID >= 50426 && (PHP_VERSION_ID < 50500 || PHP_VERSION_ID > 50509), FALSE),
91+
/* $options * / array(TRUE, FALSE),
92+
));
93+
check( 'mysqli::mysqli', array(
94+
/* $host * / array(TRUE, FALSE),
95+
/* $username * / array(TRUE, FALSE),
96+
/* $passwd * / array(TRUE, FALSE),
97+
/* $dbname * / array(TRUE, FALSE),
98+
/* $port * / array(TRUE, FALSE),
99+
/* $socket * / array(TRUE, FALSE),
100+
));
101+
*/

0 commit comments

Comments
 (0)