Author: Márk Sági-Kazár (mark.sagikazar@gmail.com)
Inheritance: extends SplObjectStorage, implements JsonSerializable
Esempio n. 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));
 }
Esempio n. 2
0
 public function testHash()
 {
     $dateTimeStorage = new DateTimeStorage();
     $dateTime = new \DateTime('2015-07-08');
     $this->assertEquals('2015-07-08', $dateTimeStorage->getHash($dateTime));
 }