Skip tests that cannot succeed on 32bits

For some reason a timestamp in the past also triggers the PHP error
 about not being able to represent it as an int, so skipping that test
 on 32bits.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2023-01-30 11:31:49 +01:00
parent 892e6c642a
commit 476d5dceb2
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -652,8 +652,15 @@ EOS;
* @dataProvider providesCalDataForGetDenormalizedData
*/
public function testGetDenormalizedData($expected, $key, $calData): void {
$actual = $this->backend->getDenormalizedData($calData);
$this->assertEquals($expected, $actual[$key]);
try {
$actual = $this->backend->getDenormalizedData($calData);
$this->assertEquals($expected, $actual[$key]);
} catch (\ValueError $e) {
if (($e->getMessage() === 'Epoch doesn\'t fit in a PHP integer') && (PHP_INT_SIZE < 8)) {
$this->markTestSkipped('This fail on 32bits because of PHP limitations in DateTime');
}
throw $e;
}
}
public function providesCalDataForGetDenormalizedData() {