-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
DynamicReturnTypeExtensionTest.php
48 lines (43 loc) · 2.17 KB
/
DynamicReturnTypeExtensionTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
declare(strict_types=1);
namespace SzepeViktor\PHPStan\WordPress\Tests;
class DynamicReturnTypeExtensionTest extends \PHPStan\Testing\TypeInferenceTestCase
{
/**
* @return iterable<mixed>
*/
public function dataFileAsserts(): iterable
{
// Path to a file with actual asserts of expected types:
yield from $this->gatherAssertTypes(__DIR__ . '/data/_get_list_table.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/apply_filters.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/current_time.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/echo_parameter.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/esc_sql.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/get_comment.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/get_object_taxonomies.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/get_post.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/get_posts.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/get_sites.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/get_terms.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/has_filter.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/mysql2date.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/shortcode_atts.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/term_exists.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/wp_error_parameter.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/wp_parse_url.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/wp_theme_get.php');
}
/**
* @dataProvider dataFileAsserts
* @param array<string> ...$args
*/
public function testFileAsserts(string $assertType, string $file, ...$args): void
{
$this->assertFileAsserts($assertType, $file, ...$args);
}
public static function getAdditionalConfigFiles(): array
{
return [dirname(__DIR__) . '/vendor/szepeviktor/phpstan-wordpress/extension.neon'];
}
}