1<?php
2/**
3 * Unit test class for the JSHint sniff.
4 *
5 * @author    Juliette Reinders Folmer <phpcs_nospam@adviesenzo.nl>
6 * @copyright 2019 Juliette Reinders Folmer. All rights reserved.
7 * @license   https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
8 */
9
10namespace PHP_CodeSniffer\Standards\Generic\Tests\Debug;
11
12use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest;
13use PHP_CodeSniffer\Config;
14
15class JSHintUnitTest extends AbstractSniffUnitTest
16{
17
18
19    /**
20     * Should this test be skipped for some reason.
21     *
22     * @return void
23     */
24    protected function shouldSkipTest()
25    {
26        $rhinoPath  = Config::getExecutablePath('rhino');
27        $jshintPath = Config::getExecutablePath('jshint');
28        if ($rhinoPath === null && $jshintPath === null) {
29            return true;
30        }
31
32        return false;
33
34    }//end shouldSkipTest()
35
36
37    /**
38     * Returns the lines where errors should occur.
39     *
40     * The key of the array should represent the line number and the value
41     * should represent the number of errors that should occur on that line.
42     *
43     * @return array<int, int>
44     */
45    public function getErrorList()
46    {
47        return [];
48
49    }//end getErrorList()
50
51
52    /**
53     * Returns the lines where warnings should occur.
54     *
55     * The key of the array should represent the line number and the value
56     * should represent the number of warnings that should occur on that line.
57     *
58     * @return array<int, int>
59     */
60    public function getWarningList()
61    {
62        return [3 => 2];
63
64    }//end getWarningList()
65
66
67}//end class
68