Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get unit tests to pass on 32-bit systems #1667

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Phing/Type/Selector/DateSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function getSeconds()
*/
public function setMillis($millis)
{
$this->setSeconds((int) $millis / 1000);
$this->setSeconds((float) $millis / 1000);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Phing/Util/SizeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function fromHumanToBytes(string $human): float
/**
* Convert from bytes to any other valid unit.
*/
public static function fromBytesTo(int $bytes, string $unit): float
public static function fromBytesTo(float $bytes, string $unit): float
{
$multiple = self::findUnitMultiple($unit);

Expand Down Expand Up @@ -95,7 +95,7 @@ protected static function parseHuman(string $human): array
/**
* Finds the value in bytes of a single "unit".
*/
protected static function findUnitMultiple(string $unit): int
protected static function findUnitMultiple(string $unit): float
{
foreach (self::IEC as $exponent => $choices) {
if (in_array(strtolower($unit), array_map('strtolower', $choices))) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Type/Selector/DateSelectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function testSecondsGranularitySixtySeconds(): void
$this->assertFileExists($this->outputDir . basename($file), $offset . ' file missing from output directory');
}

foreach ($outOfWindowFiles as $file) {
foreach ($outOfWindowFiles as $offset => $file) {
$this->assertFileDoesNotExist($this->outputDir . basename($file), $offset . ' file unexpected in output directory');
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Phing/Util/SizeHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function invalidFromHumanToBytesProvider(): array
/**
* @dataProvider fromBytesToProvider
*/
public function testFromBytesTo(int $bytes, string $unit, float $expected): void
public function testFromBytesTo(float $bytes, string $unit, float $expected): void
{
$converted = SizeHelper::fromBytesTo($bytes, $unit);
$this->assertSame($expected, $converted);
Expand Down