Failed Conditions
Branch ignore-unknown-keywords (efa676)
by Stéphane
02:58
created

RegressionTest::testApply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
dl 0
loc 21
rs 9.3142
c 1
b 1
f 1
cc 1
eloc 17
nc 1
nop 6
1
<?php
2
3
/*
4
 * This file is part of the JVal package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace JVal;
11
12
use JVal\Testing\DataTestCase;
13
14
class RegressionTest extends DataTestCase
15
{
16
    /**
17
     * @dataProvider fileDataProvider
18
     *
19
     * @param string    $file
20
     * @param string    $title
21
     * @param mixed     $instance
22
     * @param \stdClass $schema
23
     * @param bool      $isInstanceValid
24
     * @param array     $expectedErrors
25
     */
26
    public function testApply(
27
        $file,
28
        $title,
29
        $instance,
30
        \stdClass $schema,
31
        $isInstanceValid,
32
        array $expectedErrors
33
    ) {
34
        $validator = Validator::buildDefault();
35
        $actualErrors = $validator->validate($instance, $schema, $this->getLocalUri($file));
36
37
        $this->assertValidationResult(
38
            $file,
39
            $title,
40
            $instance,
41
            $schema,
42
            $isInstanceValid,
43
            $expectedErrors,
44
            $actualErrors
45
        );
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    protected function getDataDirectory()
52
    {
53
        return __DIR__.'/../Data/issues';
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    protected function getCaseFileNames()
60
    {
61
        return false;
62
    }
63
}
64