Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Feb 18, 2024
1 parent 588ba32 commit 0a17ef5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function test(string $assertType, string $file, ...$args): void
/**
* @return mixed[]
*/
public static function dataFileAsserts(): iterable
public static function dataFileAsserts(): \Iterator
{
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/existing_component_component.php');
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/invalid_component_property.php');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function test(string $assertType, string $file, ...$args): void
/**
* @return mixed[]
*/
public static function dataFileAsserts(): iterable
public static function dataFileAsserts(): \Iterator
{
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/core_model_behavior.php');
// yield from self::gatherAssertTypes(__DIR__ . '/Fixture/custom_model_behavior.php');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function test(string $assertType, string $file, ...$args): void
$this->assertFileAsserts($assertType, $file, ...$args);
}

public static function dataFileAsserts(): iterable
public static function dataFileAsserts(): \Iterator
{
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/existing_shell_model.php');
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/existing_shell_task.php');
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/ControllerExtensionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ControllerExtensionsTest extends TypeInferenceTestCase
/**
* @return mixed[]
*/
public static function dataFileAsserts(): iterable
public static function dataFileAsserts(): \Iterator
{
yield from self::gatherAssertTypes(__DIR__ . '/data/existing_controller_model.php');
yield from self::gatherAssertTypes(__DIR__ . '/data/existing_controller_component.php');
Expand Down
23 changes: 8 additions & 15 deletions tests/Feature/LoadComponentOnFlyMethodReturnTypeExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,23 @@
namespace PHPStanCakePHP2\Tests\Feature;

use PHPStan\Testing\TypeInferenceTestCase;
use PHPUnit\Framework\Attributes\DataProvider;

class LoadComponentOnFlyMethodReturnTypeExtensionTest extends TypeInferenceTestCase
final class LoadComponentOnFlyMethodReturnTypeExtensionTest extends TypeInferenceTestCase
{
/**
* @return mixed[]
*/
public static function dataFileAsserts(): iterable
#[DataProvider('dataFileAsserts')]
public function test(string $assertType, string $file, ...$args): void
{
yield from self::gatherAssertTypes(__DIR__ . '/data/loading_component_loaded_on_fly.php');
$this->assertFileAsserts($assertType, $file, ...$args);
}

/**
* @dataProvider dataFileAsserts
* @param mixed $args
*/
public function testControllerExtensions(string $assertType, string $file, ...$args): void
public static function dataFileAsserts(): \Iterator
{
$this->assertFileAsserts($assertType, $file, ...$args);
yield from self::gatherAssertTypes(__DIR__ . '/data/loading_component_loaded_on_fly.php');
}

public static function getAdditionalConfigFiles(): array
{
return [
__DIR__ . '/data/phpstan.neon',
];
return [__DIR__ . '/data/phpstan.neon'];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class ClassRegistryInitExtensionTest extends TypeInferenceTestCase
/**
* @return mixed[]
*/
public static function dataFileAsserts(): iterable
public static function dataFileAsserts(): \Iterator
{
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/variable_reference.php');
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/not_a_class.php');
Expand Down

0 comments on commit 0a17ef5

Please sign in to comment.