|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +/* |
| 6 | + * This file is part of the humbug/php-scoper package. |
| 7 | + * |
| 8 | + * Copyright (c) 2017 Théo FIDRY <[email protected]>, |
| 9 | + * Pádraic Brady <[email protected]> |
| 10 | + * |
| 11 | + * For the full copyright and license information, please view the LICENSE |
| 12 | + * file that was distributed with this source code. |
| 13 | + */ |
| 14 | + |
| 15 | +return [ |
| 16 | + 'meta' => [ |
| 17 | + 'title' => 'Name resolution', |
| 18 | + // Default values. If not specified will be the one used |
| 19 | + 'prefix' => 'Humbug', |
| 20 | + 'whitelist' => [], |
| 21 | + 'whitelist-global-constants' => true, |
| 22 | + 'whitelist-global-classes' => false, |
| 23 | + 'whitelist-global-functions' => true, |
| 24 | + 'registered-classes' => [], |
| 25 | + 'registered-functions' => [], |
| 26 | + ], |
| 27 | + |
| 28 | + 'Internal class & function with the same name' => [ |
| 29 | + 'registered-functions' => [], |
| 30 | + 'payload' => <<<'PHP' |
| 31 | +<?php |
| 32 | +
|
| 33 | +namespace PHPUnit\Framework; |
| 34 | +
|
| 35 | +use function assert; |
| 36 | +
|
| 37 | +abstract class TestCase extends Assert { |
| 38 | + function __construct() { |
| 39 | + \assert(); |
| 40 | + } |
| 41 | +} |
| 42 | +
|
| 43 | +---- |
| 44 | +<?php |
| 45 | +
|
| 46 | +namespace Humbug\PHPUnit\Framework; |
| 47 | +
|
| 48 | +use function assert; |
| 49 | +abstract class TestCase extends \Humbug\PHPUnit\Framework\Assert |
| 50 | +{ |
| 51 | + function __construct() |
| 52 | + { |
| 53 | + \assert(); |
| 54 | + } |
| 55 | +} |
| 56 | + |
| 57 | +PHP |
| 58 | + ], |
| 59 | + |
| 60 | + 'Internal class & const with the same name' => [ |
| 61 | + 'registered-functions' => [], |
| 62 | + 'payload' => <<<'PHP' |
| 63 | +<?php |
| 64 | +
|
| 65 | +namespace PHPUnit\Framework; |
| 66 | +
|
| 67 | +use const SORT_NUMERIC; |
| 68 | +
|
| 69 | +abstract class TestCase extends SORT_NUMERIC { |
| 70 | + function __construct() { |
| 71 | + echo SORT_NUMERIC; |
| 72 | + } |
| 73 | +} |
| 74 | +
|
| 75 | +---- |
| 76 | +<?php |
| 77 | +
|
| 78 | +namespace Humbug\PHPUnit\Framework; |
| 79 | +
|
| 80 | +use const SORT_NUMERIC; |
| 81 | +abstract class TestCase extends \Humbug\PHPUnit\Framework\SORT_NUMERIC |
| 82 | +{ |
| 83 | + function __construct() |
| 84 | + { |
| 85 | + echo \SORT_NUMERIC; |
| 86 | + } |
| 87 | +} |
| 88 | + |
| 89 | +PHP |
| 90 | + ], |
| 91 | +]; |
0 commit comments