約98件1ページ目

日本語のみで絞り込む

The TestWith(array $data) attribute can be used to define a data provider for a test method without having to implement a static data provider method. Example ...

2024/5/22 -The DataProvider attribute takes as an argument the method name on the current test class that we are using. The data from the array that we ...

The following example is the correct way of adding a dataprovider in PHPUnit 12: use PHPUnit\Framework\Attributes\DataProvider; class SomethingTest extends ...

2025/7/31 -Attributes ( #[<Name>] ) were introduced in PHP 8 and PHPUnit 10, they replace Annotations (PHPdoc @<Name> ) which have been deprecated in ...

2026/2/4 -Data providers document specific, important cases (including bugs found for regression testing), benefit from complete test isolation through ...

2024/8/5 -As the @dataProvider annotation is used in the test's docblock, PHPUnit will then look for the function name specified ( referenceIDDataProvider ) ...

Change dataProvider annotations to attribute. use PHPUnit\Framework\TestCase; final class SomeTest extends TestCase { - /** - * @dataProvider someMethod ...

2020/10/30 -@dataProvider methodName will be implemented as PHPUnit\Framework\Attributes\DataProvider(string $methodName) (only allowed on methods ...

2024/6/18 -You can also use the #[\PHPUnit\Framework\Attributes\DataProvider()] attribute to specify a method as a data provider for the test. The updated ...

A #[DataProvider] attribute references a method that is not public. PHPUnit requires data provider methods to be public so that the test runner can access them.