Completed
Push — develop ( 3c50bf...126c89 )
by Stan
02:00
created

TestCase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
dl 0
loc 58
rs 10
1
<?php
2
3
namespace Krenor\Http2Pusher\Tests;
4
5
use Illuminate\Http\Request;
6
use Krenor\Http2Pusher\Builder;
7
use Illuminate\Container\Container;
8
use PHPUnit\Framework\TestCase as BaseTestCase;
9
10
abstract class TestCase extends BaseTestCase
11
{
12
    /**
13
     * @var Request
14
     */
15
    protected $request;
16
17
    /**
18
     * @var Builder
19
     */
20
    protected $builder;
21
22
    /**
23
     * @var array
24
     */
25
    protected $builderSettings = [
26
        'cookie'        => [
27
            'name'     => 'h2_cache-digest',
28
            'duration' => '60 days',
29
        ],
30
        'global_pushes' => [
31
            //
32
        ],
33
    ];
34
35
    /**
36
     * @var array
37
     */
38
    protected $pushable = [
39
        '/js/app.js',
40
        '/css/app.css',
41
        '/images/chrome.svg',
42
        '/images/github.png',
43
        '/images/laravel.jpg',
44
        '/fonts/lato-light.woff2',
45
    ];
46
47
    /**
48
     * @var array
49
     */
50
    protected $nonPushable = [
51
        '/app.less',
52
        '/app.coffee',
53
        '/uploads/passwords.txt',
54
        '/uploads/tax-return.pdf',
55
    ];
56
57
    /**
58
     * Bootstrap the test environment.
59
     */
60
    public function setUp()
61
    {
62
        // The function "public_path" is in "Illuminate/Foundation" which is no standalone dependency.
63
        Container::getInstance()
64
                 ->instance('path.public', __DIR__ . DIRECTORY_SEPARATOR . 'fixtures');
65
66
        $this->request = new Request();
67
        $this->builder = new Builder($this->request, $this->builderSettings);
68
    }
69
}
70