Completed
Push — master ( 6ebd1c...df9bae )
by John
10:14
created

YamlCapableUriRetrieverTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A canRetrieveYamlFileAsJsonString() 0 9 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\Dev\Document;
10
11
use KleijnWeb\SwaggerBundle\Document\YamlCapableUriRetriever;
12
13
/**
14
 * @author John Kleijn <[email protected]>
15
 */
16
class YamlCapableUriRetrieverTest extends \PHPUnit_Framework_TestCase
17
{
18
    /**
19
     * @test
20
     */
21
    public function canRetrieveYamlFileAsJsonString()
22
    {
23
        $retriever = new YamlCapableUriRetriever();
24
        $result = $retriever->retrieve('file://' . realpath('src/Tests/Functional/PetStore/app/swagger/petstore.yml'));
25
        $this->assertInternalType('string', $result);
26
        $array = json_decode($result, true);
27
        $this->assertNotNull($array);
28
        $this->assertInternalType('array', $array);
29
    }
30
}
31