2021-03-17 01:14:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Wikimedia\DebugInfo;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers \Wikimedia\DebugInfo\Placeholder
|
|
|
|
|
*/
|
|
|
|
|
class PlaceholderTest extends \PHPUnit\Framework\TestCase {
|
2023-03-23 11:36:19 +00:00
|
|
|
public static function provideConstruct() {
|
2021-03-17 01:14:49 +00:00
|
|
|
return [
|
|
|
|
|
[
|
|
|
|
|
new \stdClass,
|
|
|
|
|
'/^stdClass#[0-9]*$/'
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
1,
|
|
|
|
|
'/^integer$/'
|
|
|
|
|
],
|
|
|
|
|
[
|
|
|
|
|
'test',
|
|
|
|
|
'/^string$/',
|
|
|
|
|
]
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @dataProvider provideConstruct
|
|
|
|
|
*/
|
|
|
|
|
public function testConstruct( $input, $expected ) {
|
|
|
|
|
$placeholder = new Placeholder( $input );
|
|
|
|
|
$this->assertInstanceOf( Placeholder::class, $placeholder );
|
|
|
|
|
$this->assertMatchesRegularExpression( $expected, $placeholder->desc );
|
|
|
|
|
}
|
|
|
|
|
}
|