Completed
Push — master ( 563f53...a34294 )
by Ibrahim
20:58 queued 05:59
created

CustomerTest::testRoot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 5
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
namespace Yabacon\Paystack\Tests\Routes;
3
4
use Yabacon\Paystack\Routes\Customer;
5
use Yabacon\Paystack\Contracts\RouteInterface;
6
7 View Code Duplication
class CustomerTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Duplication introduced by
This class 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.

Loading history...
8
{
9
    public function testRoot()
10
    {
11
        $r = new Customer();
12
        $this->assertEquals('/customer', $r->root());
13
    }
14
15
    public function testEndpoints()
16
    {
17
        $r = new Customer();
18
        $this->assertEquals('/customer', $r->create()[RouteInterface::ENDPOINT_KEY]);
19
        $this->assertEquals('/customer', $r->getList()[RouteInterface::ENDPOINT_KEY]);
20
        $this->assertEquals('/customer/{id}', $r->fetch()[RouteInterface::ENDPOINT_KEY]);
21
        $this->assertEquals('/customer/{id}', $r->update()[RouteInterface::ENDPOINT_KEY]);
22
    }
23
    
24
    public function testMethods()
25
    {
26
        $r = new Customer();
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