Completed
Push — master ( 16b7b3...90dfdb )
by Ryan
13:15
created

AbstractTestCase   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 5
dl 0
loc 29
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 18 1
1
<?php
2
/**
3
 * Copyright (c) 2017 Ryan Parman <http://ryanparman.com>.
4
 * Copyright (c) 2017 Contributors.
5
 *
6
 * http://opensource.org/licenses/Apache2.0
7
 */
8
9
declare(strict_types=1);
10
11
namespace SimplePie\Test\Integration;
12
13
use GuzzleHttp\Psr7;
14
use PHPUnit\Framework\TestCase;
15
use SimplePie\HandlerStack;
16
use SimplePie\Middleware\Xml\Atom;
17
use SimplePie\SimplePie;
18
19
abstract class AbstractTestCase extends TestCase
20
{
21
    public $feedDir;
22
23
    public $goodAtom;
24
25
    public $simplepie;
26
27
    public $feed;
28
29
    public function setUp(): void
30
    {
31
        $this->feedDir  = __DIR__ . '/feeds';
32
        $this->goodAtom = \file_get_contents($this->feedDir . '/test.atom');
33
34
        $middleware = (new HandlerStack())
35
            ->append(new Atom(), 'atom');
36
37
        $this->simplepie = (new SimplePie())
38
            ->setMiddlewareStack($middleware);
39
40
        //------------------------------------------------------------------------------
41
42
        $stream = Psr7\stream_for($this->goodAtom);
43
        $parser = $this->simplepie->parseXml($stream, true);
44
45
        $this->feed = $parser->getFeed();
46
    }
47
}
48