This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Bunq\Tests; |
||
4 | |||
5 | use Bunq\Client; |
||
6 | use GuzzleHttp\ClientInterface; |
||
7 | use GuzzleHttp\Psr7\Response; |
||
8 | use PHPUnit\Framework\TestCase; |
||
9 | use Prophecy\Prophecy\ObjectProphecy; |
||
10 | |||
11 | final class ClientTest extends TestCase |
||
12 | { |
||
13 | /** |
||
14 | * @var ClientInterface|ObjectProphecy |
||
15 | */ |
||
16 | private $httpClient; |
||
17 | |||
18 | /** |
||
19 | * @var Client |
||
20 | */ |
||
21 | private $client; |
||
22 | |||
23 | public function setUp() |
||
24 | { |
||
25 | $this->httpClient = $this->prophesize(ClientInterface::class); |
||
26 | $this->client = new Client($this->httpClient->reveal()); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @test |
||
31 | */ |
||
32 | View Code Duplication | public function itExecutesAGetRequest() |
|
0 ignored issues
–
show
|
|||
33 | { |
||
34 | /** @var Response|ObjectProphecy $response */ |
||
35 | $response = $this->prophesize(Response::class); |
||
36 | $response->getBody()->willReturn( |
||
0 ignored issues
–
show
The method
getBody does only exist in GuzzleHttp\Psr7\Response , but not in Prophecy\Prophecy\ObjectProphecy .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
37 | json_encode([ |
||
38 | 'Response' => [ |
||
39 | 'status' => 'OK' |
||
40 | ] |
||
41 | ]) |
||
42 | ); |
||
43 | |||
44 | $this->httpClient->request('GET', 'uri', [])->willReturn($response->reveal()); |
||
0 ignored issues
–
show
The method
request does only exist in GuzzleHttp\ClientInterface , but not in Prophecy\Prophecy\ObjectProphecy .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() The method
reveal does only exist in Prophecy\Prophecy\ObjectProphecy , but not in GuzzleHttp\Psr7\Response .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
45 | |||
46 | $result = $this->client->get('uri'); |
||
47 | |||
48 | $expectedResult = ['Response' => ['status' => 'OK']]; |
||
49 | |||
50 | $this->assertEquals($expectedResult, $result); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @test |
||
55 | */ |
||
56 | View Code Duplication | public function itExecutesAPostRequest() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
57 | { |
||
58 | /** @var Response|ObjectProphecy $response */ |
||
59 | $response = $this->prophesize(Response::class); |
||
60 | $response->getBody()->willReturn( |
||
0 ignored issues
–
show
The method
getBody does only exist in GuzzleHttp\Psr7\Response , but not in Prophecy\Prophecy\ObjectProphecy .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
61 | json_encode([ |
||
62 | 'Response' => [ |
||
63 | 'status' => 'OK' |
||
64 | ] |
||
65 | ]) |
||
66 | ); |
||
67 | |||
68 | $this->httpClient->request('POST', 'uri', [])->willReturn($response->reveal()); |
||
0 ignored issues
–
show
The method
request does only exist in GuzzleHttp\ClientInterface , but not in Prophecy\Prophecy\ObjectProphecy .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() The method
reveal does only exist in Prophecy\Prophecy\ObjectProphecy , but not in GuzzleHttp\Psr7\Response .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
69 | |||
70 | $result = $this->client->post('uri'); |
||
71 | |||
72 | $expectedResult = ['Response' => ['status' => 'OK']]; |
||
73 | |||
74 | $this->assertEquals($expectedResult, $result); |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * @test |
||
79 | */ |
||
80 | View Code Duplication | public function itExecutesAPutRequest() |
|
0 ignored issues
–
show
This method seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
81 | { |
||
82 | /** @var Response|ObjectProphecy $response */ |
||
83 | $response = $this->prophesize(Response::class); |
||
84 | $response->getBody()->willReturn( |
||
0 ignored issues
–
show
The method
getBody does only exist in GuzzleHttp\Psr7\Response , but not in Prophecy\Prophecy\ObjectProphecy .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
85 | json_encode([ |
||
86 | 'Response' => [ |
||
87 | 'status' => 'OK' |
||
88 | ] |
||
89 | ]) |
||
90 | ); |
||
91 | |||
92 | $this->httpClient->request('PUT', 'uri', [])->willReturn($response->reveal()); |
||
0 ignored issues
–
show
The method
request does only exist in GuzzleHttp\ClientInterface , but not in Prophecy\Prophecy\ObjectProphecy .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() The method
reveal does only exist in Prophecy\Prophecy\ObjectProphecy , but not in GuzzleHttp\Psr7\Response .
It seems like the method you are trying to call exists only in some of the possible types. Let’s take a look at an example: class A
{
public function foo() { }
}
class B extends A
{
public function bar() { }
}
/**
* @param A|B $x
*/
function someFunction($x)
{
$x->foo(); // This call is fine as the method exists in A and B.
$x->bar(); // This method only exists in B and might cause an error.
}
Available Fixes
![]() |
|||
93 | |||
94 | $result = $this->client->put('uri'); |
||
95 | |||
96 | $expectedResult = ['Response' => ['status' => 'OK']]; |
||
97 | |||
98 | $this->assertEquals($expectedResult, $result); |
||
99 | } |
||
100 | } |
||
101 | |||
102 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.