Skip to content

Commit 54aa935

Browse files
committed
Cleanup tests.
1 parent 8aa74ca commit 54aa935

File tree

4 files changed

+85
-126
lines changed

4 files changed

+85
-126
lines changed

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
return RectorConfig::configure()
99
->withPaths([
10-
__DIR__ . '\.',
10+
__DIR__ . '/.',
1111
])
1212
->withSkip([
1313
__DIR__ . '/.git',

tests/Integration/LinterIntegrationTest.php

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

tests/Unit/Rules/CisRulesTest.php

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Yousha\PhpSecurityLinter\Unit\Rules;
5+
namespace Yousha\PhpSecurityLinter\Tests\Unit\Rules;
66

77
use PHPUnit\Framework\TestCase;
88
use Yousha\PhpSecurityLinter\Rules\CisRules;
@@ -11,11 +11,53 @@ final class CisRulesTest extends TestCase
1111
{
1212
private array $rules;
1313

14+
/**
15+
* This method is called before the first test method in the test class is executed.
16+
*
17+
* @doesNotPerformAssertions
18+
*
19+
* @return void
20+
*/
21+
public static function setUpBeforeClass(): void {}
22+
23+
/**
24+
* This method is called after the last test method in the test class has been executed.
25+
*
26+
* @doesNotPerformAssertions
27+
*
28+
* @return void
29+
*/
30+
public static function tearDownAfterClass(): void
31+
{
32+
gc_collect_cycles();
33+
}
34+
35+
/**
36+
* This method is called BEFORE each test method.
37+
*
38+
* @doesNotPerformAssertions
39+
*
40+
* @return void
41+
*/
1442
protected function setUp(): void
1543
{
44+
parent::setUp();
1645
$this->rules = CisRules::getRules();
1746
}
1847

48+
/**
49+
* This method is called AFTER each test method.
50+
*
51+
* @doesNotPerformAssertions
52+
*
53+
* @return void
54+
*/
55+
protected function tearDown(): void
56+
{
57+
// Methods finalization codes.
58+
parent::tearDown();
59+
}
60+
1961
/**
2062
* Test that the rules array is correctly structured and not empty.
2163
*/

tests/Unit/Rules/OwaspRulesTest.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,53 @@ final class OwaspRulesTest extends TestCase
1111
{
1212
private array $rules;
1313

14+
/**
15+
* This method is called before the first test method in the test class is executed.
16+
*
17+
* @doesNotPerformAssertions
18+
*
19+
* @return void
20+
*/
21+
public static function setUpBeforeClass(): void {}
22+
23+
/**
24+
* This method is called after the last test method in the test class has been executed.
25+
*
26+
* @doesNotPerformAssertions
27+
*
28+
* @return void
29+
*/
30+
public static function tearDownAfterClass(): void
31+
{
32+
gc_collect_cycles();
33+
}
34+
35+
/**
36+
* This method is called BEFORE each test method.
37+
*
38+
* @doesNotPerformAssertions
39+
*
40+
* @return void
41+
*/
1442
protected function setUp(): void
1543
{
1644
parent::setUp();
1745
$this->rules = OwaspRules::getRules();
1846
}
1947

48+
/**
49+
* This method is called AFTER each test method.
50+
*
51+
* @doesNotPerformAssertions
52+
*
53+
* @return void
54+
*/
55+
protected function tearDown(): void
56+
{
57+
// Methods finalization codes.
58+
parent::tearDown();
59+
}
60+
2061
public function ruleDataProvider(): array
2162
{
2263
$rules = OwaspRules::getRules();

0 commit comments

Comments
 (0)