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
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\ClassMethod\TestWithAnnotationToAttributeRector\Fixture;

class KeepStringAsIs extends \PHPUnit\Framework\TestCase
{
/**
* @testWith ["2", 2, "null", "true", "false", true, false]
* ["benjamin.sisko@ds9.example.com"]
*/
public function testSomething(string $userId): void
{
}
}

?>
-----
<?php

namespace Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\ClassMethod\TestWithAnnotationToAttributeRector\Fixture;

class KeepStringAsIs extends \PHPUnit\Framework\TestCase
{
#[\PHPUnit\Framework\Attributes\TestWith(['2', 2, 'null', 'true', 'false', true, false])]
#[\PHPUnit\Framework\Attributes\TestWith(['benjamin.sisko@ds9.example.com'])]
public function testSomething(string $userId): void
{
}
}

?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector\Fixture;

use PHPUnit\Framework\TestCase;

final class TestdoxMultiDoubleColon extends TestCase
{
/**
* @testdox ::property is true ::property2 is true as well
*/
public function myAwesomeTest(): void
{
}
}

?>
-----
<?php

namespace Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector\Fixture;

use PHPUnit\Framework\TestCase;

final class TestdoxMultiDoubleColon extends TestCase
{
#[\PHPUnit\Framework\Attributes\TestDox('::property is true ::property2 is true as well')]
public function myAwesomeTest(): void
{
}
}

?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector\Fixture;

use PHPUnit\Framework\TestCase;

final class TestdoxSingle extends TestCase
{
/**
* @testdox ::property is true
*/
public function myAwesomeTest(): void
{
}
}

?>
-----
<?php

namespace Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\Class_\AnnotationWithValueToAttributeRector\Fixture;

use PHPUnit\Framework\TestCase;

final class TestdoxSingle extends TestCase
{
#[\PHPUnit\Framework\Attributes\TestDox('::property is true')]
public function myAwesomeTest(): void
{
}
}

?>
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
]),
new AnnotationWithValueToAttribute('dataProvider', 'PHPUnit\Framework\Attributes\DataProvider'),
new AnnotationWithValueToAttribute('uses', 'PHPUnit\Framework\Attributes\UsesClass', [], true),
new AnnotationWithValueToAttribute('testdox', 'PHPUnit\Framework\Attributes\TestDox'),
]);
};
Loading