OAuth1ServerStub.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. namespace SocialiteProviders\Manager\Test\Stubs;
  3. use League\OAuth1\Client\Credentials\TokenCredentials;
  4. use SocialiteProviders\Manager\OAuth1\Server;
  5. use SocialiteProviders\Manager\OAuth1\User;
  6. class OAuth1ServerStub extends Server
  7. {
  8. /**
  9. * Get the URL for retrieving temporary credentials.
  10. *
  11. * @return string
  12. */
  13. public function urlTemporaryCredentials()
  14. {
  15. return 'test';
  16. }
  17. /**
  18. * Get the URL for redirecting the resource owner to authorize the client.
  19. *
  20. * @return string
  21. */
  22. public function urlAuthorization()
  23. {
  24. return 'test';
  25. }
  26. /**
  27. * Get the URL retrieving token credentials.
  28. *
  29. * @return string
  30. */
  31. public function urlTokenCredentials()
  32. {
  33. return 'test';
  34. }
  35. /**
  36. * Get the URL for retrieving user details.
  37. *
  38. * @return string
  39. */
  40. public function urlUserDetails()
  41. {
  42. return 'test';
  43. }
  44. /**
  45. * Take the decoded data from the user details URL and convert
  46. * it to a User object.
  47. *
  48. * @param mixed $data
  49. * @param TokenCredentials $tokenCredentials
  50. * @return \SocialiteProviders\Manager\OAuth1\User
  51. */
  52. public function userDetails($data, TokenCredentials $tokenCredentials)
  53. {
  54. return new User;
  55. }
  56. /**
  57. * Take the decoded data from the user details URL and extract
  58. * the user's UID.
  59. *
  60. * @param mixed $data
  61. * @param TokenCredentials $tokenCredentials
  62. * @return string|int
  63. */
  64. public function userUid($data, TokenCredentials $tokenCredentials)
  65. {
  66. return 1;
  67. }
  68. /**
  69. * Take the decoded data from the user details URL and extract
  70. * the user's email.
  71. *
  72. * @param mixed $data
  73. * @param TokenCredentials $tokenCredentials
  74. * @return string
  75. */
  76. public function userEmail($data, TokenCredentials $tokenCredentials)
  77. {
  78. return 'test';
  79. }
  80. /**
  81. * Take the decoded data from the user details URL and extract
  82. * the user's screen name.
  83. *
  84. * @param mixed $data
  85. * @param TokenCredentials $tokenCredentials
  86. * @return string
  87. */
  88. public function userScreenName($data, TokenCredentials $tokenCredentials)
  89. {
  90. return 'test';
  91. }
  92. }