Completed
Pull Request — dev (#11)
by
unknown
05:12 queued 01:17
created

TestDummyController::testAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 1 Features 0
Metric Value
c 4
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Vectorface\SnappyRouterTests\Controller;
4
5
use \Exception;
6
use Vectorface\SnappyRouter\Controller\AbstractController;
7
use Vectorface\SnappyRouter\Exception\InternalErrorException;
8
9
/**
10
 * A test controller for testing the router.
11
 * @copyright Copyright (c) 2014, VectorFace, Inc.
12
 * @author Dan Bruce <[email protected]>
13
 */
14
class TestDummyController extends AbstractController
15
{
16
17
    public function indexAction()
18
    {
19
20
    }
21
22
    public function testAction()
23
    {
24
        return 'This is a test service.';
25
    }
26
27
    public function genericExceptionAction()
28
    {
29
        throw new InternalErrorException('A generic exception.');
30
    }
31
32
    public function defaultAction()
33
    {
34
        // ensure some abstract methods work
35
        $this->set('request', $this->getRequest());
36
        $this->get('request');
37
    }
38
39
    public function arrayAction()
40
    {
41
        $this->viewContext['variable'] = 'broken';
42
        return array('variable' => 'test');
43
    }
44
45
    public function otherViewAction()
46
    {
47
        return $this->renderView(
48
            array('variable' => 'test'),
49
            'test/array.twig'
50
        );
51
    }
52
}
53