Passed
Pull Request — master (#11)
by Pavel
08:05
created

SecurityTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 17
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testPrivateMethodRequest() 0 7 1
A testPublicMethodRequest() 0 6 1
1
<?php
2
3
namespace Bankiru\Api\JsonRpc\Test\Tests;
4
5
use Bankiru\Api\Rpc\Test\Impl\Request;
6
use ScayTrase\Api\JsonRpc\JsonRpcError;
7
8
final class SecurityTest extends JsonRpcTestCase
9
{
10 1
    public function testPrivateMethodRequest()
11
    {
12 1
        $response = $this->sendJsonRpcRequest(new Request('prefix/security/private', []), '/test/');
13
14 1
        self::assertFalse($response->isSuccessful());
15 1
        self::assertEquals($response->getError()->getCode(), JsonRpcError::METHOD_NOT_FOUND);
16 1
    }
17
18 1
    public function testPublicMethodRequest()
19
    {
20 1
        $response = $this->sendJsonRpcRequest(new Request('prefix/security/public', []), '/test/');
21
22 1
        self::assertTrue($response->isSuccessful(), json_encode($response, JSON_PRETTY_PRINT));
23 1
    }
24
}
25