Skip to content

Commit

Permalink
Merge pull request #10 from netlogix/bugfix/add-type-hints-to-tests
Browse files Browse the repository at this point in the history
BUGFIX: Add missing type hints to tests
  • Loading branch information
saschanowak authored Jan 14, 2021
2 parents 13f4c62 + b0d80d9 commit c758685
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function setUp(): void
/**
* @test
*/
public function Can_return_empty_array()
public function Can_return_empty_array(): void
{
$files = $this->fileSystemMigrationsResolver->findMigrationFiles();
$this->assertCount(0, $files);
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Domain/Service/MigrationExecutorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function setUp(): void
/**
* @test
*/
public function It_Will_Throw_Missing_Migration_Handler()
public function It_Will_Throw_Missing_Migration_Handler(): void
{
$this->expectException(MissingMigrationHandler::class);

Expand All @@ -75,7 +75,7 @@ public function It_Will_Throw_Missing_Migration_Handler()
/**
* @test
*/
public function It_Will_Execute_Migration_Handler()
public function It_Will_Execute_Migration_Handler(): void
{
$migration = $this->createMock(Migration::class);

Expand Down
8 changes: 4 additions & 4 deletions Tests/Unit/Domain/Service/MigrationServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function setUp(): void
/**
* @test
*/
public function Can_Return_UnexecutedMigrations()
public function Can_Return_UnexecutedMigrations(): void
{
$migrationMock = $this->getMockBuilder(Migration::class)
->getMock();
Expand All @@ -94,7 +94,7 @@ public function Can_Return_UnexecutedMigrations()
/**
* @test
*/
public function Can_Filter_Executed_Migrations_In_Get_UnexecutedMigrations()
public function Can_Filter_Executed_Migrations_In_Get_UnexecutedMigrations(): void
{
$migrationMock = $this->getMockBuilder(Migration::class)
->getMock();
Expand All @@ -121,7 +121,7 @@ public function Can_Filter_Executed_Migrations_In_Get_UnexecutedMigrations()
/**
* @test
*/
public function Can_Return_A_Single_Migration()
public function Can_Return_A_Single_Migration(): void
{
$migrationMock = $this->getMockBuilder(Migration::class)
->getMock();
Expand All @@ -147,7 +147,7 @@ public function Can_Return_A_Single_Migration()
/**
* @test
*/
public function Will_Throw_Unknown_Migration_If_Migration_Not_Found()
public function Will_Throw_Unknown_Migration_If_Migration_Not_Found(): void
{
$this->expectException(UnknownMigration::class);

Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Domain/Service/VersionLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function setUp(): void
/**
* @test
*/
public function Can_Store_New_MigrationStatus_On_Up()
public function Can_Store_New_MigrationStatus_On_Up(): void
{
$migration = $this->createMock(Migration::class);

Expand All @@ -66,7 +66,7 @@ public function Can_Store_New_MigrationStatus_On_Up()
/**
* @test
*/
public function Can_Remove_MigrationStatus_On_Down()
public function Can_Remove_MigrationStatus_On_Down(): void
{
$migration = $this->createMock(Migration::class);

Expand Down
8 changes: 4 additions & 4 deletions Tests/Unit/Domain/Service/VersionResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function setUp(): void
* @test
* @dataProvider validClassNames
*/
public function Can_extract_version_string(string $migrationClassName, string $expectedVersionString)
public function Can_extract_version_string(string $migrationClassName, string $expectedVersionString): void
{
$this->assertEquals($expectedVersionString, $this->versionResolver->extractVersion($migrationClassName));
}
Expand All @@ -33,13 +33,13 @@ public function Can_extract_version_string(string $migrationClassName, string $e
* @test
* @dataProvider invalidClassNames
*/
public function Can_not_extract_version_string(string $migrationClassName)
public function Can_not_extract_version_string(string $migrationClassName): void
{
$this->expectException(InvalidClassName::class);
$this->versionResolver->extractVersion($migrationClassName);
}

public function invalidClassNames()
public function invalidClassNames(): array
{
return [
'lower case class name' => ['version20201111145100'],
Expand All @@ -48,7 +48,7 @@ public function invalidClassNames()
];
}

public function validClassNames()
public function validClassNames(): array
{
return [
'class name without namespace' => ['Version20190930132259', '20190930132259'],
Expand Down

0 comments on commit c758685

Please sign in to comment.