MDL-58718 unit tests: fix some windows + 32bits problems

- We were using number beyond 32 bits MAXINT.
- setTimestamp() needs an integer. Better fulfill it.
This commit is contained in:
Eloy Lafuente (stronk7) 2017-04-25 20:21:48 +02:00 committed by Andrew Nicols
parent faedb2736e
commit a25116c0ac
4 changed files with 15 additions and 15 deletions

View File

@ -130,9 +130,9 @@ class core_calendar_action_event_test_event implements event_interface {
public function get_times() {
return new event_times(
(new \DateTimeImmutable())->setTimestamp('-2461276800'),
(new \DateTimeImmutable())->setTimestamp('115776000'),
(new \DateTimeImmutable())->setTimestamp('115776000'),
(new \DateTimeImmutable())->setTimestamp(-386380800),
(new \DateTimeImmutable())->setTimestamp(115776000),
(new \DateTimeImmutable())->setTimestamp(115776000),
(new \DateTimeImmutable())->setTimestamp(time())
);
}

View File

@ -334,9 +334,9 @@ class event_mapper_test_event implements event_interface {
public function get_times() {
return new event_times(
(new \DateTimeImmutable())->setTimestamp('-2461276800'),
(new \DateTimeImmutable())->setTimestamp('115776000'),
(new \DateTimeImmutable())->setTimestamp('115776000'),
(new \DateTimeImmutable())->setTimestamp(-386380800),
(new \DateTimeImmutable())->setTimestamp(115776000),
(new \DateTimeImmutable())->setTimestamp(115776000),
(new \DateTimeImmutable())->setTimestamp(time())
);
}

View File

@ -89,9 +89,9 @@ class core_calendar_event_testcase extends advanced_testcase {
'course_module' => new std_proxy(1, $lamecallable),
'type' => 'dunno what this actually is meant to be',
'times' => new event_times(
(new \DateTimeImmutable())->setTimestamp('-2461276800'),
(new \DateTimeImmutable())->setTimestamp('115776000'),
(new \DateTimeImmutable())->setTimestamp('115776000'),
(new \DateTimeImmutable())->setTimestamp(-386380800),
(new \DateTimeImmutable())->setTimestamp(115776000),
(new \DateTimeImmutable())->setTimestamp(115776000),
(new \DateTimeImmutable())->setTimestamp(time())
),
'visible' => true,

View File

@ -61,17 +61,17 @@ class core_calendar_event_times_testcase extends advanced_testcase {
return [
'Dataset 1' => [
'constructorparams' => [
'start_time' => (new \DateTimeImmutable())->setTimestamp('-2461276800'),
'end_time' => (new \DateTimeImmutable())->setTimestamp('115776000'),
'sort_time' => (new \DateTimeImmutable())->setTimestamp('115776000'),
'start_time' => (new \DateTimeImmutable())->setTimestamp(-386380800),
'end_time' => (new \DateTimeImmutable())->setTimestamp(115776000),
'sort_time' => (new \DateTimeImmutable())->setTimestamp(115776000),
'modified_time' => (new \DateTimeImmutable())->setTimestamp(time())
]
],
'Dataset 2' => [
'constructorparams' => [
'start_time' => (new \DateTimeImmutable())->setTimestamp('123456'),
'end_time' => (new \DateTimeImmutable())->setTimestamp('12345678'),
'sort_time' => (new \DateTimeImmutable())->setTimestamp('1111'),
'start_time' => (new \DateTimeImmutable())->setTimestamp(123456),
'end_time' => (new \DateTimeImmutable())->setTimestamp(12345678),
'sort_time' => (new \DateTimeImmutable())->setTimestamp(1111),
'modified_time' => (new \DateTimeImmutable())->setTimestamp(time())
]
]