Completed
Push — master ( 805a89...b85748 )
by John
02:52
created

OperationObjectTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A canBuildBodyReference() 0 11 1
1
<?php
2
/*
3
 * This file is part of the KleijnWeb\SwaggerBundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace KleijnWeb\SwaggerBundle\Tests\Document;
10
11
use KleijnWeb\SwaggerBundle\Document\DocumentRepository;
12
use KleijnWeb\SwaggerBundle\Document\OperationObject;
13
use Symfony\Component\HttpFoundation\Request;
14
15
/**
16
 * @author John Kleijn <[email protected]>
17
 */
18
class OperationObjectTest extends \PHPUnit_Framework_TestCase
19
{
20
    /**
21
     * @test
22
     */
23
    public function canBuildBodyReference()
24
    {
25
        $repository = new DocumentRepository('src/Tests/Functional/PetStore/app');
26
        $document   = $repository->get('swagger/petstore.yml');
27
        $operation  = new OperationObject($document, '/store/order', 'post');
28
29
        $pointer = $operation->createParameterSchemaPointer('body.properties.quantity');
30
31
        $expected = '/paths/~1store~1order/post/x-request-schema/properties/body/properties/quantity';
32
        $this->assertEquals($expected, $pointer);
33
    }
34
}
35