server_mocks.php 393 B

1234567891011121314151617
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * A set of 'mocks' that replace the PHP global functions to aid testing.
  5. */
  6. namespace Cake\Http;
  7. function headers_sent(?string &$file = null, ?int &$line = null): bool
  8. {
  9. return $GLOBALS['mockedHeadersSent'] ?? true;
  10. }
  11. function header(string $header, bool $replace = true, int $response_code = 0): void
  12. {
  13. $GLOBALS['mockedHeaders'][] = $header;
  14. }