mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
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:
parent
faedb2736e
commit
a25116c0ac
@ -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())
|
||||
);
|
||||
}
|
||||
|
@ -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())
|
||||
);
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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())
|
||||
]
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user