Passed
Push — static-analysis ( 536d5c...894217 )
by SignpostMarv
03:17
created

FilesystemTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
dl 0
loc 20
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace GoetasWebservices\XML\XSDReader\Tests;
4
5
class FilesystemTest extends BaseTest
6
{
7
8
    /**
9
     * Test that a referenced Xsd file is found when the base-path contains " " (space-character).
10
     *
11
     * Covers the issue described in {@link https://github.com/goetas/xsd-reader/pull/10 PR #10}.
12
     */
13
    public function testReferencedOnFileSystem_1()
14
    {
15
        /*
16
         * Using vfsStream seems ideal, but currently seems to have an issue with directorypaths with a space in
17
         * combination with DOMDocument::load(). For now use actual filesystem to create the testcase.
18
         */
19
        $schemaXsd = __DIR__ . DIRECTORY_SEPARATOR . 'foo bar' . DIRECTORY_SEPARATOR . 'schema.xsd';
20
21
        $schema = $this->reader->readFile($schemaXsd);
22
23
        $this->assertCount(1, $schema->getTypes());
24
        $this->assertInstanceOf('GoetasWebservices\XML\XSDReader\Schema\Type\ComplexType', $schema->findType('myType', 'http://www.example.com'));
25
    }
26
27
}
28