Skip to content

Commit

Permalink
TASK: Adjust dataProviders to be static, other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kdambekalns committed Dec 9, 2024
1 parent 8fc4ebf commit 8435768
Show file tree
Hide file tree
Showing 40 changed files with 954 additions and 819 deletions.
25 changes: 6 additions & 19 deletions Neos.Cache/Tests/Unit/Backend/FileBackendEntryDtoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FileBackendEntryDtoTest extends BaseTestCase
{
/**
*/
public function validEntryConstructorParameters()
public static function validEntryConstructorParameters(): array
{
return [
['data', [], 0],
Expand All @@ -29,13 +29,8 @@ public function validEntryConstructorParameters()
/**
* @dataProvider validEntryConstructorParameters
* @test
*
* @param string $data
* @param array $tags
* @param int $expiryTime
* @return void
*/
public function canBeCreatedWithConstructor($data, $tags, $expiryTime)
public function canBeCreatedWithConstructor(string $data, array $tags, int $expiryTime): void
{
$entryDto = new FileBackendEntryDto($data, $tags, $expiryTime);
self::assertInstanceOf(FileBackendEntryDto::class, $entryDto);
Expand All @@ -44,13 +39,8 @@ public function canBeCreatedWithConstructor($data, $tags, $expiryTime)
/**
* @dataProvider validEntryConstructorParameters
* @test
*
* @param $data
* @param $tags
* @param $expiryTime
* @return void
*/
public function gettersReturnDataProvidedToConstructor($data, $tags, $expiryTime)
public function gettersReturnDataProvidedToConstructor(string $data, array $tags, int $expiryTime): void
{
$entryDto = new FileBackendEntryDto($data, $tags, $expiryTime);
self::assertEquals($data, $entryDto->getData());
Expand All @@ -60,19 +50,17 @@ public function gettersReturnDataProvidedToConstructor($data, $tags, $expiryTime

/**
* @test
* @return void
*/
public function isExpiredReturnsFalseIfExpiryTimeIsInFuture()
public function isExpiredReturnsFalseIfExpiryTimeIsInFuture(): void
{
$entryDto = new FileBackendEntryDto('data', [], time() + 10);
self::assertFalse($entryDto->isExpired());
}

/**
* @test
* @return void
*/
public function isExpiredReturnsTrueIfExpiryTimeIsInPast()
public function isExpiredReturnsTrueIfExpiryTimeIsInPast(): void
{
$entryDto = new FileBackendEntryDto('data', [], time() - 10);
self::assertTrue($entryDto->isExpired());
Expand All @@ -81,9 +69,8 @@ public function isExpiredReturnsTrueIfExpiryTimeIsInPast()
/**
* @dataProvider validEntryConstructorParameters
* @test
* @return void
*/
public function isIdempotent($data, $tags, $expiryTime)
public function isIdempotent(string $data, array $tags, int $expiryTime): void
{
$entryDto = new FileBackendEntryDto($data, $tags, $expiryTime);
$entryString = (string)$entryDto;
Expand Down
Loading

0 comments on commit 8435768

Please sign in to comment.