Skip to content

Commit 034b652

Browse files
committed
add isTest tests with php attributes for existing rector rules
1 parent b845d5f commit 034b652

File tree

9 files changed

+69
-173
lines changed

9 files changed

+69
-173
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\ClassMethod\TestWithAnnotationToAttributeRector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
7+
final class SomeFixtureWithTestAttribute extends TestCase
8+
{
9+
/**
10+
* @testWith ["foo"]
11+
* ["bar"]
12+
*/
13+
#[\PHPUnit\Framework\Attributes\Test]
14+
public function shouldDoSomething(): void
15+
{
16+
}
17+
}
18+
19+
?>
20+
-----
21+
<?php
22+
23+
namespace Rector\PHPUnit\Tests\AnnotationsToAttributes\Rector\ClassMethod\TestWithAnnotationToAttributeRector\Fixture;
24+
25+
use PHPUnit\Framework\TestCase;
26+
27+
final class SomeFixtureWithTestAttribute extends TestCase
28+
{
29+
#[\PHPUnit\Framework\Attributes\Test]
30+
#[\PHPUnit\Framework\Attributes\TestWith(['foo'])]
31+
#[\PHPUnit\Framework\Attributes\TestWith(['bar'])]
32+
public function shouldDoSomething(): void
33+
{
34+
}
35+
}
36+
37+
?>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace Rector\PHPUnit\Tests\PHPUnit60\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector\Fixture;
4+
5+
class TestInAnnotatoinWithTestAttribute extends \PHPUnit\Framework\TestCase
6+
{
7+
#[\PHPUnit\Framework\Attributes\Test]
8+
public function thisIsTest()
9+
{
10+
$nothing = 5;
11+
}
12+
}
13+
14+
?>
15+
-----
16+
<?php
17+
18+
namespace Rector\PHPUnit\Tests\PHPUnit60\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector\Fixture;
19+
20+
class TestInAnnotatoinWithTestAttribute extends \PHPUnit\Framework\TestCase
21+
{
22+
/**
23+
* @doesNotPerformAssertions
24+
*/
25+
#[\PHPUnit\Framework\Attributes\Test]
26+
public function thisIsTest()
27+
{
28+
$nothing = 5;
29+
}
30+
}
31+
32+
?>

tests/AddTestsVoidReturnTypeWhereNoReturn/AddTestsVoidReturnTypeWhereNoReturnTest.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests/AddTestsVoidReturnTypeWhereNoReturn/Fixture/test_attribute.php.inc

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/AddTestsVoidReturnTypeWhereNoReturn/Fixture/test_docblock.php.inc

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/AddTestsVoidReturnTypeWhereNoReturn/Fixture/test_prefix_camelcase.php.inc

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/AddTestsVoidReturnTypeWhereNoReturn/Fixture/test_prefix_snakecase.php.inc

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/AddTestsVoidReturnTypeWhereNoReturn/Fixture/test_private_method.php.inc

Lines changed: 0 additions & 31 deletions
This file was deleted.

tests/AddTestsVoidReturnTypeWhereNoReturn/config/add_tests_void_return_type_where_no_return.php

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)