저자: Márk Sági-Kazár (mark.sagikazar@gmail.com)
상속: extends SplObjectStorage, implements JsonSerializable
예제 #1
0
 public function testJsonSerialize()
 {
     $dateTimeStorage = new DateTimeStorage();
     $dateTimeStorage->attach(new \DateTime('2016-02-23'));
     $dateTimeStorage->attach(new \DateTime('2016-02-24'));
     $dateTimeStorage->attach(new \DateTime('2016-02-25'));
     $this->assertJsonStringEqualsJsonFile(__DIR__ . '/Expected/DateTimeStorage/testJsonSerialize.json', json_encode($dateTimeStorage));
 }
예제 #2
0
 public function testHash()
 {
     $dateTimeStorage = new DateTimeStorage();
     $dateTime = new \DateTime('2015-07-08');
     $this->assertEquals('2015-07-08', $dateTimeStorage->getHash($dateTime));
 }