Test Failed
Branch master (3f2e80)
by Gabriel
03:43 queued 01:39
created

AbstractRequestTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 9
c 1
b 0
f 1
dl 0
loc 26
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A newRequest() 0 6 1
A newRequestWithInitTest() 0 6 1
1
<?php
2
3
namespace ByTIC\Omnipay\Paylike\Tests\Message;
4
5
//use ByTIC\Omnipay\Paylike\Tests\Traits\HasTestUtilMethods;
6
use ByTIC\Omnipay\Paylike\Message\AbstractRequest;
7
use ByTIC\Omnipay\Paylike\Tests\AbstractTest;
8
use Symfony\Component\HttpFoundation\Request as HttpRequest;
9
10
/**
11
 * Class AbstractRequestTest
12
 * @package ByTIC\Omnipay\Paylike\Tests\Message
13
 */
14
abstract class AbstractRequestTest extends AbstractTest
15
{
16
17
    /**
18
     * @param string $class
19
     * @param array $data
20
     * @return AbstractRequest
21
     */
22
    protected function newRequestWithInitTest($class, $data)
23
    {
24
        $request = $this->newRequest($class);
25
        self::assertInstanceOf($class, $request);
26
        $request->initialize($data);
27
        return $request;
28
    }
29
30
    /**
31
     * @param string $class
32
     * @return AbstractRequest
33
     */
34
    protected function newRequest($class)
35
    {
36
        $client = $this->getHttpClient();
0 ignored issues
show
Bug introduced by
The method getHttpClient() does not exist on ByTIC\Omnipay\Paylike\Te...age\AbstractRequestTest. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
        /** @scrutinizer ignore-call */ 
37
        $client = $this->getHttpClient();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
        $request = HttpRequest::createFromGlobals();
38
        $request = new $class($client, $request);
39
        return $request;
40
    }
41
}
42