Exemplo n.º 1
0
 public function test_json_structure()
 {
     $id = 'someidentifier-31337';
     $dateTime = new \DateTimeImmutable();
     $title = 'Some Title';
     $pin = Pin::create($id, $dateTime, $title);
     $json = $pin->json();
     $jsonObject = json_decode($json);
     $this->assertInstanceOf('stdClass', $jsonObject);
     $this->assertEquals($id, $jsonObject->id);
     $this->assertEquals($dateTime->format(DATE_ATOM), $jsonObject->time);
     $this->assertEquals($title, $jsonObject->layout->title);
 }
Exemplo n.º 2
0
 private function getTestData()
 {
     $id = 'foobar-1234';
     $dateTime = new \DateTimeImmutable();
     $title = 'SomeTitle';
     $pin = Pin::create($id, $dateTime, $title);
     $token = TimelineToken::fromString(str_repeat('a', 32));
     return ['id' => $id, 'dateTime' => $dateTime, 'title' => $title, 'pin' => $pin, 'token' => $token, 'timeline' => new GuzzleTimeline($this->client, $token)];
 }