public function testUserId()
 {
     $expected = '273c4392-4c5k-4c3b-a70e-72375216702f';
     $this->assertNull($this->user->getUserId());
     $this->assertSame($this->user, $this->user->setUserId($expected));
     $this->assertEquals($expected, $this->user->getUserId());
 }
 public function testCreateUser()
 {
     $expectedId = 'foobar123';
     // Set mocked response
     $body = new Stream(fopen(sprintf('data://text/plain,{"userId": "%s"}', $expectedId), 'r'));
     $this->subscriber->addResponse(new Response(200, [], $body));
     $newUser = new User();
     $newUser->setEmail('*****@*****.**')->setDateOfBirth(new \DateTime('1970-01-01 00:00:00'))->setFullName('John Doe');
     $this->assertNull($newUser->getUserId());
     $this->client->createUser($newUser);
     $this->assertEquals($expectedId, $newUser->getUserId());
 }
 /**
  * Returns the list of most recent updates for certain user
  *
  * @param User|string $user A User model or userId
  * @param int $maxCount
  * @return Collection|Update[]
  */
 public function getUserLastUpdates($user, $maxCount = null)
 {
     $queryParams = [];
     if (is_int($maxCount)) {
         $queryParams['minCount'] = $maxCount;
     }
     $route = new Route(self::USER_LAST_UPDATES, ['userId' => $user instanceof User ? $user->getUserId() : $user], $queryParams);
     return $this->getResourceCollection($route, 'lastUpdates', 'Wonnova\\SDK\\Model\\Update');
 }