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

canRetrieveYamlFileAsJsonString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 9
rs 9.6666
cc 1
eloc 7
nc 1
nop 0
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