public function test_that_exception_string_is_dependent_on_token() { $tokenString = str_repeat('0123456789abcdef', 2); $token = TimelineToken::fromString($tokenString); $invalidTimelineToken = new InvalidTimelineToken($token); $this->assertSame("Invalid Timeline token: {$tokenString}", $invalidTimelineToken->getMessage()); }
/** * InvalidTimelineToken constructor. * * @param TimelineToken $token */ public function __construct(TimelineToken $token) { $this->timelineToken = $token; parent::__construct("Invalid Timeline token: " . $token->toString()); }
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)]; }
/** * @param array $customHeaders * * @return array */ private function getHeaders($customHeaders = []) { return array_merge(['Content-Type' => 'application/json', 'X-User-Token' => $this->token->toString()], $customHeaders); }