/**
  * @test
  */
 public function serializeShouldReturnArrayWithSignedUpKeyIfUserHasSignedUpAtDate()
 {
     $user = $this->anUser();
     $user->expects($this->once())->method('getSignedUpAt')->willReturn($this->getMock(DateTime::class));
     $serialized = $this->serializer->serialize($user);
     $this->assertArrayHasKey('signed_up_at', $serialized);
 }
 /**
  * @test
  */
 public function createUserShouldSerializeAndDelegateCreationToClient()
 {
     $serialized = [];
     $user = $this->anUser();
     $this->serializer->expects($this->once())->method('serialize')->with($user)->willReturn($serialized);
     $this->client->expects($this->once())->method('createUser')->with($serialized);
     $this->manager->createUser($user);
 }
Esempio n. 3
0
 /**
  * Sends a user to Intercom API
  *
  * @api
  *
  * @param UserInterface $user
  */
 public function createUser(UserInterface $user)
 {
     $this->client->createUser($this->serializer->serialize($user));
 }