Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions tests/PHPStan/Rules/Debug/DumpNativeTypeRuleTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php declare(strict_types = 1);

namespace PHPStan\Rules\Debug;

use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;

/**
* @extends RuleTestCase<DumpNativeTypeRule>
*/
class DumpNativeTypeRuleTest extends RuleTestCase
{

protected function getRule(): Rule
{
return new DumpNativeTypeRule(self::createReflectionProvider());
}

public function testRule(): void
{
$this->analyse([__DIR__ . '/data/dump-native-type.php'], [
[
'Dumped type: non-empty-array',
11,
],
[
'Dumped type: array',
12,
],
]);
}

}
13 changes: 13 additions & 0 deletions tests/PHPStan/Rules/Debug/data/dump-native-type.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace PHPStan;

/** @param non-empty-array $b */
function (array $a, array $b) {
if ($a === []) {
return;
}

dumpNativeType($a);
dumpNativeType($b);
};
Loading