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

SecurityTest::testPrivateMethodRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 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