Completed
Push — master ( ee12eb...1b7bb6 )
by Ibrahim
03:01 queued 01:04
created

PlanTest::testEndpoints()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 8
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 8
loc 8
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
namespace Yabacon\Paystack\Tests\Routes;
3
4
use Yabacon\Paystack\Routes\Plan;
5
use Yabacon\Paystack\Contracts\RouteInterface;
6
7
class PlanTest extends \PHPUnit_Framework_TestCase
8
{
9
    public function testRoot()
10
    {
11
        $r = new Plan();
12
        $this->assertEquals('/plan', $r->root());
13
    }
14
15
    public function testEndpoints()
16
    {
17
        $r = new Plan();
18
        $this->assertEquals('/plan', $r->create()[RouteInterface::ENDPOINT_KEY]);
19
        $this->assertEquals('/plan', $r->getList()[RouteInterface::ENDPOINT_KEY]);
20
        $this->assertEquals('/plan/{id}', $r->fetch()[RouteInterface::ENDPOINT_KEY]);
21
        $this->assertEquals('/plan/{id}', $r->update()[RouteInterface::ENDPOINT_KEY]);
22
    }
23
    
24
    public function testMethods()
25
    {
26
        $r = new Plan();
27
        $this->assertEquals(RouteInterface::POST_METHOD, $r->create()[RouteInterface::METHOD_KEY]);
28
        $this->assertEquals(RouteInterface::GET_METHOD, $r->getList()[RouteInterface::METHOD_KEY]);
29
        $this->assertEquals(RouteInterface::GET_METHOD, $r->fetch()[RouteInterface::METHOD_KEY]);
30
        $this->assertEquals(RouteInterface::PUT_METHOD, $r->update()[RouteInterface::METHOD_KEY]);
31
    }
32
}
33