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

gettingDocumentThatDoestExistWillConstructIt()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
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\DocumentRepository;
12
13
/**
14
 * @author John Kleijn <[email protected]>
15
 */
16
class DocumentRepositoryTest extends \PHPUnit_Framework_TestCase
17
{
18
    /**
19
     * @test
20
     * @expectedException \InvalidArgumentException
21
     */
22
    public function willFailWhenKeyIsEmpty()
23
    {
24
        $repository = new DocumentRepository();
25
        $repository->get('');
26
    }
27
28
    /**
29
     * @test
30
     */
31
    public function gettingDocumentThatDoestExistWillConstructIt()
32
    {
33
        $repository = new DocumentRepository();
34
        $document = $repository->get('src/Tests/Functional/PetStore/app/swagger/petstore.yml');
35
        $this->assertInstanceOf('KleijnWeb\SwaggerBundle\Document\SwaggerDocument', $document);
36
    }
37
38
    /**
39
     * @test
40
     */
41
    public function canUsePathPrefix()
42
    {
43
        $repository = new DocumentRepository('src/Tests/Functional/PetStore');
44
        $document = $repository->get('app/swagger/petstore.yml');
45
        $this->assertInstanceOf('KleijnWeb\SwaggerBundle\Document\SwaggerDocument', $document);
46
    }
47
}
48