/**
  * Returns the user_id if available.
  *
  * @return string|null
  */
 public function getUserId()
 {
     return $this->signedRequest ? $this->signedRequest->getUserId() : null;
 }
 public function testARawSignedRequestCanBeInjectedIntoTheConstructorToInstantiateANewEntity()
 {
     $signedRequest = new SignedRequest($this->rawSignedRequest, 'foo_state', $this->appSecret);
     $rawSignedRequest = $signedRequest->getRawSignedRequest();
     $payloadData = $signedRequest->getPayload();
     $userId = $signedRequest->getUserId();
     $hasOAuthData = $signedRequest->hasOAuthData();
     $this->assertInstanceOf('\\Facebook\\Entities\\SignedRequest', $signedRequest);
     $this->assertEquals($this->rawSignedRequest, $rawSignedRequest);
     $this->assertEquals($this->payloadData, $payloadData);
     $this->assertEquals(123, $userId);
     $this->assertTrue($hasOAuthData);
 }