Skip to content

Commit

Permalink
test: do not use a data provider on 64-bit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Sep 26, 2022
1 parent 6626b1d commit 6e51d8c
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions tests/unit/Service/Node/StaticNodeServiceTest.php
Expand Up @@ -125,37 +125,17 @@ public function nodeProvider(): array
];
}

/**
* @param int<0, max> | non-empty-string $staticNode
*
* @dataProvider nodeProvider64Bit
*/
public function testGetNode64Bit(int | string $staticNode, string $expected): void
public function testGetNode64Bit(): void
{
if (PHP_INT_SIZE < 8) {
$this->markTestSkipped('Skipping on 32-bit build of PHP');
}

$service = new StaticNodeService($staticNode);

$this->assertSame($expected, $service->getNode());
}
$service1 = new StaticNodeService(0xffff0000);
$service2 = new StaticNodeService(66048975238464);

/**
* @return array<array{staticNode: int<0, max> | non-empty-string, expected: string}>
*/
public function nodeProvider64Bit(): array
{
return [
[
'staticNode' => 0xffff0000,
'expected' => '0100ffff0000',
],
[
'staticNode' => 66048975238464,
'expected' => '3d1239b4f540',
],
];
$this->assertSame('0100ffff0000', $service1->getNode());
$this->assertSame('3d1239b4f540', $service2->getNode());
}

/**
Expand Down

0 comments on commit 6e51d8c

Please sign in to comment.