@@ -11,11 +11,11 @@ use Nette\Reflection,
1111require __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
4242check ( '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