Skip to content

Commit 15681be

Browse files
committed
WIP cleanup tests
1 parent 0a72567 commit 15681be

6 files changed

Lines changed: 19 additions & 48 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
12+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1313

1414
steps:
1515
- uses: actions/checkout@v2

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
},
2222
"require": {
2323
"php": ">=7.1",
24-
"composer-plugin-api": "^1.0 || ^2.0"
24+
"composer-plugin-api": "^2.0"
2525
},
2626
"require-dev": {
27-
"composer/composer": "^1.1@dev || ^2.0@dev",
27+
"composer/composer": "^2.0@dev",
2828
"mikey179/vfsstream": "~1.4.0@dev",
29-
"phpunit/phpunit": ">4.8 <9"
29+
"phpunit/phpunit": "^8 || ^9"
3030
},
3131
"replace": {
3232
"helhum/class-alias-loader": "*"

tests/Unit/BaseTestCase.php

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

tests/Unit/ClassAliasLoaderTest.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,31 @@
1212

1313
use Composer\Autoload\ClassLoader as ComposerClassLoader;
1414
use PHPUnit\Framework\MockObject\MockObject;
15+
use PHPUnit\Framework\TestCase;
1516
use TYPO3\ClassAliasLoader\ClassAliasLoader;
1617

1718
/**
1819
* Test case for ClassAliasLoader
1920
*/
20-
class ClassAliasLoaderTest extends BaseTestCase
21+
class ClassAliasLoaderTest extends TestCase
2122
{
2223
/**
2324
* @var ClassAliasLoader
2425
*/
2526
protected $subject;
2627

2728
/**
28-
* @var ComposerClassLoader|MockObject|PHPUnit_Framework_MockObject_MockObject
29+
* @var ComposerClassLoader|MockObject
2930
*/
3031
protected $composerClassLoaderMock;
3132

32-
/**
33-
* @before
34-
*/
35-
public function setMeUp()
33+
public function setUp(): void
3634
{
3735
$this->composerClassLoaderMock = $this->getMockBuilder('Composer\\Autoload\\ClassLoader')->getMock();
3836
$this->subject = new ClassAliasLoader($this->composerClassLoaderMock);
3937
}
4038

41-
/**
42-
* @after
43-
*/
44-
public function tearMeDown()
39+
public function tearDown(): void
4540
{
4641
$this->subject->unregister();
4742
}

tests/Unit/ConfigTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,34 @@
1212

1313
use Composer\IO\IOInterface;
1414
use Composer\Package\PackageInterface;
15+
use PHPUnit\Framework\MockObject\MockObject;
16+
use PHPUnit\Framework\TestCase;
1517
use TYPO3\ClassAliasLoader\Config;
1618

1719
/**
1820
* Test case for Config
1921
*/
20-
class ConfigTest extends BaseTestCase
22+
class ConfigTest extends TestCase
2123
{
2224
/**
2325
* @var Config
2426
*/
2527
protected $subject;
2628

2729
/**
28-
* @var IOInterface|\PHPUnit_Framework_MockObject_MockObject
30+
* @var IOInterface|MockObject
2931
*/
3032
protected $ioMock;
3133

3234
/**
33-
* @var PackageInterface|\PHPUnit_Framework_MockObject_MockObject
35+
* @var PackageInterface|MockObject
3436
*/
3537
protected $packageMock;
3638

37-
/**
38-
* @before
39-
*/
40-
public function setMeUp()
39+
public function setUp(): void
4140
{
4241
$this->ioMock = $this->getMockBuilder('Composer\\IO\\IOInterface')->getMock();
4342
$this->packageMock = $this->getMockBuilder('Composer\\Package\\PackageInterface')->getMock();
44-
4543
$this->subject = new Config($this->packageMock, $this->ioMock);
4644
}
4745

tests/Unit/IncludeFileTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
use Composer\IO\IOInterface;
1515
use Composer\Package\PackageInterface;
1616
use PHPUnit\Framework\MockObject\MockObject;
17+
use PHPUnit\Framework\TestCase;
1718
use TYPO3\ClassAliasLoader\Config;
1819
use TYPO3\ClassAliasLoader\IncludeFile;
1920

2021
/**
2122
* Test case for IncludeFile
2223
*/
23-
final class IncludeFileTest extends BaseTestCase
24+
final class IncludeFileTest extends TestCase
2425
{
2526
/**
2627
* @var IncludeFile
@@ -44,10 +45,7 @@ final class IncludeFileTest extends BaseTestCase
4445

4546
private $testDir = __DIR__;
4647

47-
/**
48-
* @before
49-
*/
50-
public function setMeUp()
48+
public function setUp(): void
5149
{
5250
$this->ioMock = $this->getMockBuilder('Composer\\IO\\IOInterface')->getMock();
5351
$this->packageMock = $this->getMockBuilder('Composer\\Package\\RootPackageInterface')->getMock();
@@ -84,10 +82,7 @@ public function setMeUp()
8482
);
8583
}
8684

87-
/**
88-
* @after
89-
*/
90-
public function tearMeDown()
85+
public function tearDown(): void
9186
{
9287
unlink($this->testDir . IncludeFile::INCLUDE_FILE);
9388
rmdir(dirname($this->testDir . IncludeFile::INCLUDE_FILE));

0 commit comments

Comments
 (0)