Skip to content

Commit fc78501

Browse files
authored
refactor: drop deprecated EveryTestHasSameNamespaceAsTestedClass check (#72)
1 parent 08b34e1 commit fc78501

File tree

9 files changed

+1
-262
lines changed

9 files changed

+1
-262
lines changed

README.md

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ use PHPUnit\Framework\TestCase;
8989

9090
/**
9191
* @group integration
92-
* @testedClass none
92+
* @coversNothing
9393
*/
9494
final class SuiteComplianceTest extends TestCaseBase
9595
{
@@ -191,54 +191,6 @@ yield 'Every test has same namespace as tested class' => [
191191
];
192192
```
193193

194-
### Every test has same namespace as tested class
195-
196-
Asserts that all test share same namespace with class they're testing.
197-
Consider src namespace `Ns` and test namespace `Ns/Tests` then for test `Ns/Tests/UnitTest` must exist class `Ns/Unit`.
198-
199-
You can use `@testedClass` annotation to link test with tested class
200-
201-
```php
202-
namespace Ns;
203-
204-
final class Unit {}
205-
```
206-
207-
:x:
208-
```php
209-
namespace Ns\Tests;
210-
211-
final class NonexistentUnitTest extends TestCase {}
212-
```
213-
214-
```php
215-
namespace Ns\Tests\Sub;
216-
217-
final class UnitTest extends TestCase {}
218-
```
219-
220-
:heavy_check_mark:
221-
```php
222-
namespace Ns\Tests;
223-
224-
final class UnitTest extends TestCase {}
225-
```
226-
227-
```php
228-
namespace Ns\Tests\Sub;
229-
230-
/** @testedClass \Ns\Unit */
231-
final class UnitTest extends TestCase {}
232-
```
233-
234-
Configured in test provider as
235-
236-
```php
237-
yield 'Every test has same namespace as tested class' => [
238-
new EveryTestHasSameNamespaceAsTestedClass($testFiles),
239-
];
240-
```
241-
242194
### Every test inherits from testcase base class
243195

244196
Consider you have a base for all tests and want each of them extend it.

src/TestCheck/EveryTestHasSameNamespaceAsTestedClass.php

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

tests/TestCheck/EveryTestHasSameNamespaceAsTestedClassTest.php

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

tests/TestCheck/Fixtures/EveryTestHasSameNamespaceAsTestedClass/SameNamespace.php

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

tests/TestCheck/Fixtures/EveryTestHasSameNamespaceAsTestedClass/tests/MissingAnnotationsTest.php

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

tests/TestCheck/Fixtures/EveryTestHasSameNamespaceAsTestedClass/tests/NoLinkTest.php

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

tests/TestCheck/Fixtures/EveryTestHasSameNamespaceAsTestedClass/tests/NonexistentLinkTest.php

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

tests/TestCheck/Fixtures/EveryTestHasSameNamespaceAsTestedClass/tests/SameNamespaceLinkedTest.php

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

tests/TestCheck/Fixtures/EveryTestHasSameNamespaceAsTestedClass/tests/SameNamespaceTest.php

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

0 commit comments

Comments
 (0)