Skip to content
This repository was archived by the owner on Dec 29, 2020. It is now read-only.

Commit 79f6b55

Browse files
committed
tests: add normalization/whitelist test
1 parent f0270cd commit 79f6b55

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* @param integer $integer
4+
* @param boolean $boolean
5+
* @param real $real
6+
* @param double $double
7+
* @param callback $callback
8+
* @param void $void
9+
* @param mixed $mixed
10+
* @param unknown $unknown
11+
* @param Class $class
12+
*/
13+
function aliases($integer, $boolean, $real, $double, $callback, $void, $mixed, $unkown, $class) {
14+
}

tests/test.php

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function param_no_type($noType)
238238
}
239239

240240
$projectFactory = ProjectFactory::createInstance();
241-
$project = $projectFactory->create('paramNoType', [__DIR__.'/Fixtures/array_no_types.php']);
241+
$project = $projectFactory->create('arrayNoTypes', [__DIR__.'/Fixtures/array_no_types.php']);
242242

243243
foreach ($project->getFiles() as $path => $file) {
244244
$expected = <<<'PHP'
@@ -257,4 +257,29 @@ function array_no_types(array $ints, array $strings, array $someClasses) : array
257257
same($expected, $converter->convert($project, $file));
258258
}
259259

260+
261+
$projectFactory = ProjectFactory::createInstance();
262+
$project = $projectFactory->create('typeAliasesWhitelisting', [__DIR__.'/Fixtures/type_aliases_and_whitelisting.php']);
263+
264+
foreach ($project->getFiles() as $path => $file) {
265+
$expected = <<<'PHP'
266+
<?php
267+
/**
268+
* @param integer $integer
269+
* @param boolean $boolean
270+
* @param real $real
271+
* @param double $double
272+
* @param callback $callback
273+
* @param void $void
274+
* @param mixed $mixed
275+
* @param unknown $unknown
276+
* @param Class $class
277+
*/
278+
function aliases(int $integer, bool $boolean, $real, float $double, callable $callback, $void, $mixed, $unkown, \Class $class) {
279+
}
280+
281+
PHP;
282+
same($expected, $converter->convert($project, $file));
283+
}
284+
260285
echo 'Good job! Everything is fine.'.PHP_EOL;

0 commit comments

Comments
 (0)