pest-plugin-drift icon indicating copy to clipboard operation
pest-plugin-drift copied to clipboard

@testWith annotations not converted

Open stevebauman opened this issue 2 years ago • 0 comments

PHPUnit supports @testWith annotations which is the same as providing a with() dataset to a Pest test:

PHPUnit Input:

class SomeTest extends TestCase
{
    /**
     * @testWith
     * ["1"]
     * [1]
     * [true]
     */
    public function testIsTruthy($value)
    {
        $this->assertTrue((bool) $value);
    }
}

Expected Output:

test('is truthy', function ($value) {
    expect($value)->toBeTrue();
})->with([
    "1",
    1,
    true,
]);

Actual Output:

test('is truthy', function ($value) {
    expect($value)->toBeTrue();
});

stevebauman avatar Nov 17 '23 21:11 stevebauman