mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-17 21:38:14 +01:00
44 lines
802 B
PHP
44 lines
802 B
PHP
<?php
|
|
|
|
namespace DebugBar\Tests;
|
|
|
|
use DebugBar\HttpDriverInterface;
|
|
|
|
class MockHttpDriver implements HttpDriverInterface
|
|
{
|
|
public $headers = array();
|
|
|
|
public $sessionStarted = true;
|
|
|
|
public $session = array();
|
|
|
|
function setHeaders(array $headers)
|
|
{
|
|
$this->headers = array_merge($this->headers, $headers);
|
|
}
|
|
|
|
function isSessionStarted()
|
|
{
|
|
return $this->sessionStarted;
|
|
}
|
|
|
|
function setSessionValue($name, $value)
|
|
{
|
|
$this->session[$name] = $value;
|
|
}
|
|
|
|
function hasSessionValue($name)
|
|
{
|
|
return array_key_exists($name, $this->session);
|
|
}
|
|
|
|
function getSessionValue($name)
|
|
{
|
|
return $this->session[$name];
|
|
}
|
|
|
|
function deleteSessionValue($name)
|
|
{
|
|
unset($this->session[$name]);
|
|
}
|
|
} |