Passed
Push — master ( 718618...cd6f65 )
by Vladimir
02:24
created

FakeRequest::getIsPost()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
/**
3
 * @link https://github.com/yiimaker/yii2-newsletter
4
 * @copyright Copyright (c) 2017 Yii Maker
5
 * @license BSD 3-Clause License
6
 */
7
8
namespace ymaker\newsletter\tests\mock;
9
10
use yii\web\Request;
11
12
/**
13
 * Feke request component for mock in tests
14
 *
15
 * @author Vladimir Kuprienko <[email protected]>
16
 * @since 1.0
17
 */
18
class FakeRequest extends Request
19
{
20
    /**
21
     * @inheritdoc
22
     */
23
    public function getIsPost()
24
    {
25
        return true;
26
    }
27
28
    /**
29
     * @inheritdoc
30
     */
31
    public function post($name = null, $defaultValue = null)
32
    {
33
        return [
34
            'NewsletterClient' => ['contacts' => '[email protected]'],
35
        ];
36
    }
37
}
38