Completed
Pull Request — master (#105)
by
unknown
02:10
created

FakeManagerRequestFilter::postRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 2
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Registers fake web services which are connected to a temporary database.
4
 * The registration is for the lifetime of the current request only,
5
 * but the database can persist beyond that, and share state with other
6
 * web requests as well as Behat CLI execution.
7
 *
8
 * The database is reset through..TBC
9
 */
10
class FakeManagerRequestFilter {
11
12
    public function preRequest($req, $session, $model) {
0 ignored issues
show
Unused Code introduced by
The parameter $req is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $session is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $model is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
13
        if(class_exists('TestSessionEnvironment')) {
14
            // Set in Mysite\Test\Behaviour\FeatureContext
15
            $testState = Injector::inst()->get('TestSessionEnvironment')->getState();
16
17
            if($testState && isset($testState->fakeDatabasePath) && $testState->fakeDatabasePath) {
18
                $fakeDb = new FakeDatabase($testState->fakeDatabasePath);
19
                Injector::inst()->get('FakeManager', false, array($fakeDb));
20
            }
21
        }
22
    }
23
24
    public function postRequest() {
25
    }
26
}