| 1 |
<?php |
| 2 |
|
| 3 |
namespace Wikimedia\Tests\DebugInfo; |
| 4 |
|
| 5 |
use PHPUnit\Framework\TestCase; |
| 6 |
use stdClass; |
| 7 |
use Wikimedia\DebugInfo\Placeholder; |
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
class PlaceholderTest extends TestCase { |
| 13 |
public static function provideConstruct() { |
| 14 |
return [ |
| 15 |
[ |
| 16 |
new stdClass, |
| 17 |
'/^stdClass#[0-9]*$/' |
| 18 |
], |
| 19 |
[ |
| 20 |
1, |
| 21 |
'/^int$/' |
| 22 |
], |
| 23 |
[ |
| 24 |
'test', |
| 25 |
'/^string$/', |
| 26 |
] |
| 27 |
]; |
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
public function testConstruct( $input, $expected ) { |
| 34 |
$placeholder = new Placeholder( $input ); |
| 35 |
$this->assertInstanceOf( Placeholder::class, $placeholder ); |
| 36 |
$this->assertMatchesRegularExpression( $expected, $placeholder->desc ); |
| 37 |
} |
| 38 |
} |