Skip to content

Commit

Permalink
Merge pull request #7375 from kenjis/test-comment-out-testUnserialize…
Browse files Browse the repository at this point in the history
…TimeObject

test: Temporary solution for PHP 8.2.4 SIGSEGV
  • Loading branch information
kenjis authored Mar 24, 2023
2 parents 0954e8a + 2508a76 commit 829bcb2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
21 changes: 11 additions & 10 deletions tests/system/I18n/TimeLegacyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1124,16 +1124,17 @@ public function testGetter()
$this->assertNull($time->weekOfWeek);
}

public function testUnserializeTimeObject()
{
$time1 = new TimeLegacy('August 28, 2020 10:04:00pm', 'Asia/Manila', 'en');
$timeCache = serialize($time1);
$time2 = unserialize($timeCache);

$this->assertInstanceOf(TimeLegacy::class, $time2);
$this->assertTrue($time2->equals($time1));
$this->assertNotSame($time1, $time2);
}
// @TODO Uncomment when PHP 8.2.4 Segmentation fault fixed.
// public function testUnserializeTimeObject()
// {
// $time1 = new TimeLegacy('August 28, 2020 10:04:00pm', 'Asia/Manila', 'en');
// $timeCache = serialize($time1);
// $time2 = unserialize($timeCache);
//
// $this->assertInstanceOf(TimeLegacy::class, $time2);
// $this->assertTrue($time2->equals($time1));
// $this->assertNotSame($time1, $time2);
// }

public function testSetTestNowWithFaLocale()
{
Expand Down
21 changes: 11 additions & 10 deletions tests/system/I18n/TimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1127,16 +1127,17 @@ public function testGetter()
$this->assertNull($time->weekOfWeek);
}

public function testUnserializeTimeObject()
{
$time1 = new Time('August 28, 2020 10:04:00pm', 'Asia/Manila', 'en');
$timeCache = serialize($time1);
$time2 = unserialize($timeCache);

$this->assertInstanceOf(Time::class, $time2);
$this->assertTrue($time2->equals($time1));
$this->assertNotSame($time1, $time2);
}
// @TODO Uncomment when PHP 8.2.4 Segmentation fault fixed.
// public function testUnserializeTimeObject()
// {
// $time1 = new Time('August 28, 2020 10:04:00pm', 'Asia/Manila', 'en');
// $timeCache = serialize($time1);
// $time2 = unserialize($timeCache);
//
// $this->assertInstanceOf(Time::class, $time2);
// $this->assertTrue($time2->equals($time1));
// $this->assertNotSame($time1, $time2);
// }

public function testSetTestNowWithTimeZone()
{
Expand Down

0 comments on commit 829bcb2

Please sign in to comment.