mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-17 13:28:35 +01:00
45 lines
803 B
PHP
45 lines
803 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]);
|
|
}
|
|
}
|