ServerRequestMock.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <?php
  2. namespace Test\Michel\Framework\Core\Mock;
  3. use Psr\Http\Message\MessageInterface;
  4. use Psr\Http\Message\RequestInterface;
  5. use Psr\Http\Message\ServerRequestInterface;
  6. use Psr\Http\Message\StreamInterface;
  7. use Psr\Http\Message\UriInterface;
  8. class ServerRequestMock implements ServerRequestInterface
  9. {
  10. public function __construct(
  11. array $attributes = []
  12. )
  13. {
  14. $this->attributes = $attributes;
  15. }
  16. public function getServerParams(): array
  17. {
  18. // TODO: Implement getServerParams() method.
  19. }
  20. public function getCookieParams(): array
  21. {
  22. // TODO: Implement getCookieParams() method.
  23. }
  24. public function withCookieParams(array $cookies): ServerRequestInterface
  25. {
  26. // TODO: Implement withCookieParams() method.
  27. }
  28. public function getQueryParams(): array
  29. {
  30. // TODO: Implement getQueryParams() method.
  31. }
  32. public function withQueryParams(array $query): ServerRequestInterface
  33. {
  34. // TODO: Implement withQueryParams() method.
  35. }
  36. public function getUploadedFiles(): array
  37. {
  38. // TODO: Implement getUploadedFiles() method.
  39. }
  40. public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface
  41. {
  42. // TODO: Implement withUploadedFiles() method.
  43. }
  44. public function getParsedBody()
  45. {
  46. // TODO: Implement getParsedBody() method.
  47. }
  48. public function withParsedBody($data): ServerRequestInterface
  49. {
  50. // TODO: Implement withParsedBody() method.
  51. }
  52. public function getAttributes(): array
  53. {
  54. return $this->attributes;
  55. }
  56. public function getAttribute(string $name, $default = null)
  57. {
  58. return $this->attributes[$name] ?? $default;
  59. }
  60. public function withAttribute(string $name, $value): ServerRequestInterface
  61. {
  62. // TODO: Implement withAttribute() method.
  63. }
  64. public function withoutAttribute(string $name): ServerRequestInterface
  65. {
  66. // TODO: Implement withoutAttribute() method.
  67. }
  68. private array $attributes;
  69. public function getProtocolVersion(): string
  70. {
  71. // TODO: Implement getProtocolVersion() method.
  72. }
  73. public function withProtocolVersion(string $version): MessageInterface
  74. {
  75. // TODO: Implement withProtocolVersion() method.
  76. }
  77. public function getHeaders(): array
  78. {
  79. return [];
  80. }
  81. public function hasHeader(string $name): bool
  82. {
  83. // TODO: Implement hasHeader() method.
  84. }
  85. public function getHeader(string $name): array
  86. {
  87. // TODO: Implement getHeader() method.
  88. }
  89. public function getHeaderLine(string $name): string
  90. {
  91. // TODO: Implement getHeaderLine() method.
  92. }
  93. public function withHeader(string $name, $value): MessageInterface
  94. {
  95. // TODO: Implement withHeader() method.
  96. }
  97. public function withAddedHeader(string $name, $value): MessageInterface
  98. {
  99. // TODO: Implement withAddedHeader() method.
  100. }
  101. public function withoutHeader(string $name): MessageInterface
  102. {
  103. // TODO: Implement withoutHeader() method.
  104. }
  105. public function getBody(): StreamInterface
  106. {
  107. // TODO: Implement getBody() method.
  108. }
  109. public function withBody(StreamInterface $body): MessageInterface
  110. {
  111. // TODO: Implement withBody() method.
  112. }
  113. public function getRequestTarget(): string
  114. {
  115. // TODO: Implement getRequestTarget() method.
  116. }
  117. public function withRequestTarget(string $requestTarget): RequestInterface
  118. {
  119. // TODO: Implement withRequestTarget() method.
  120. }
  121. public function getMethod(): string
  122. {
  123. // TODO: Implement getMethod() method.
  124. }
  125. public function withMethod(string $method): RequestInterface
  126. {
  127. // TODO: Implement withMethod() method.
  128. }
  129. public function getUri(): UriInterface
  130. {
  131. // TODO: Implement getUri() method.
  132. }
  133. public function withUri(UriInterface $uri, bool $preserveHost = false): RequestInterface
  134. {
  135. // TODO: Implement withUri() method.
  136. }
  137. }