Passed
Pull Request — master (#15)
by Ylva
02:37
created

GeotagControllerTest::testIndexActioncontent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
nc 1
nop 0
dl 0
loc 8
c 1
b 0
f 0
cc 1
rs 10
1
<?php
2
3
namespace Ylvan\Controller;
4
5
use Anax\DI\DIFactoryConfig;
0 ignored issues
show
Bug introduced by
The type Anax\DI\DIFactoryConfig was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * Test the SampleController.
10
 */
11
class GeotagControllerTest extends TestCase
12
{
13
14
15
    // Create the di container.
16
    protected $di;
17
    protected $controller;
18
19
20
21
    /**
22
     * Prepare before each test.
23
     */
24
    protected function setUp()
25
    {
26
        global $di;
27
28
        // Setup di
29
        $this->di = new DIFactoryConfig();
30
        $this->di->loadServices(ANAX_INSTALL_PATH . "/config/di");
31
32
        // Use a different cache dir for unit test
33
        $this->di->get("cache")->setPath(ANAX_INSTALL_PATH . "/test/cache");
34
35
        // View helpers uses the global $di so it needs its value
36
        $di = $this->di;
37
38
        // Setup the controller
39
        $this->controller = new GeotagController();
40
        $this->controller->setDI($this->di);
41
        //$this->controller->initialize();
42
    }
43
44
45
    /**
46
     * Test the route "index".
47
     */
48
    public function testIndexActionType()
49
    {
50
        $res = $this->controller->indexAction();
51
        // $this->assertInstanceOf("\Anax\Response\Response", $res);
52
53
        // $body = $res->getBody();
54
        // $exp = "Validera IP</title>";
55
        $this->assertIsObject($res);
56
    }
57
58
    /**
59
     * Test the route "index".
60
     */
61
    public function testIndexActioncontent()
62
    {
63
        $res = $this->controller->indexAction();
64
        // $this->assertInstanceOf("\Anax\Response\Response", $res);
65
66
        // $body = $res->getBody();
67
        // $exp = "Validera IP</title>";
68
        $this->assertNotNull($res);
69
    }
70
}
71