forked from evaisse/SimpleHttpBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractTests.php
More file actions
40 lines (31 loc) · 926 Bytes
/
AbstractTests.php
File metadata and controls
40 lines (31 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Created by PhpStorm.
* User: evaisse
* Date: 02/06/15
* Time: 11:15
*/
namespace evaisse\SimpleHttpBundle\Tests\Unit;
use evaisse\SimpleHttpBundle\Http\Kernel;
use evaisse\SimpleHttpBundle\Service\Helper;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher;
class AbstractTests extends TestCase
{
public static $baseUrl = null;
public function __construct(?string $name = null, array $data = [], $dataName = '')
{
parent::__construct($name, $data, $dataName);
self::$baseUrl = self::$baseUrl ?? getenv('HTTP_BIN_URL');
}
/**
* @return array{0: Helper, 1: Kernel}
*/
protected function createContext()
{
$eventDispatcher = new EventDispatcher();
$httpKernel = new Kernel($eventDispatcher);
$helper = new Helper($httpKernel, $eventDispatcher);
return [$helper, $httpKernel];
}
}