PATH:
opt
/
cpanel
/
ea-wappspector
/
vendor
/
squizlabs
/
php_codesniffer
/
src
/
Standards
/
Generic
/
Tests
/
Files
<?php /** * Unit test class for the LowercasedFilename sniff. * * @author Andy Grunwald <andygrunwald@gmail.com> * @copyright 2010-2014 Andy Grunwald * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ namespace PHP_CodeSniffer\Standards\Generic\Tests\Files; use PHP_CodeSniffer\Files\DummyFile; use PHP_CodeSniffer\Ruleset; use PHP_CodeSniffer\Tests\ConfigDouble; use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; /** * Unit test class for the LowercasedFilename sniff. * * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LowercasedFilenameSniff */ final class LowercasedFilenameUnitTest extends AbstractSniffUnitTest { /** * Get a list of all test files to check. * * @param string $testFileBase The base path that the unit tests files will have. * * @return string[] */ protected function getTestFiles($testFileBase) { $testFileDir = dirname($testFileBase); $testFiles = parent::getTestFiles($testFileBase); $testFiles[] = $testFileDir.DIRECTORY_SEPARATOR.'lowercased_filename_unit_test.inc'; return $testFiles; }//end getTestFiles() /** * Returns the lines where errors should occur. * * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * * @param string $testFile The name of the file being tested. * * @return array<int, int> */ public function getErrorList($testFile='') { switch ($testFile) { case 'LowercasedFilenameUnitTest.1.inc': case 'LowercasedFilenameUnitTest.2.inc': return [1 => 1]; default: return []; } }//end getErrorList() /** * Returns the lines where warnings should occur. * * The key of the array should represent the line number and the value * should represent the number of warnings that should occur on that line. * * @return array<int, int> */ public function getWarningList() { return []; }//end getWarningList() /** * Test the sniff bails early when handling STDIN. * * @return void */ public function testStdIn() { $config = new ConfigDouble(); $config->standards = ['Generic']; $config->sniffs = ['Generic.Files.LowercasedFilename']; $ruleset = new Ruleset($config); $content = '<?php '; $file = new DummyFile($content, $ruleset, $config); $file->process(); $this->assertSame(0, $file->getErrorCount()); $this->assertSame(0, $file->getWarningCount()); $this->assertCount(0, $file->getErrors()); }//end testStdIn() }//end class
[-] InlineHTMLUnitTest.5.inc
[edit]
[-] OneTraitPerFileUnitTest.php
[edit]
[-] EndFileNewlineUnitTest.1.inc
[edit]
[-] LineEndingsUnitTest.js.fixed
[edit]
[-] LineEndingsUnitTest.php
[edit]
[-] OneInterfacePerFileUnitTest.php
[edit]
[-] EndFileNewlineUnitTest.7.inc.fixed
[edit]
[-] ExecutableFileUnitTest.4.inc
[edit]
[-] EndFileNoNewlineUnitTest.php
[edit]
[-] EndFileNewlineUnitTest.3.js
[edit]
[-] EndFileNoNewlineUnitTest.2.js
[edit]
[-] EndFileNewlineUnitTest.4.inc
[edit]
[-] EndFileNoNewlineUnitTest.9.inc.fixed
[edit]
[-] LowercasedFilenameUnitTest.1.inc
[edit]
[-] EndFileNewlineUnitTest.7.inc
[edit]
[-] ExecutableFileUnitTest.1.inc
[edit]
[+]
..
[-] EndFileNewlineUnitTest.3.css.fixed
[edit]
[-] EndFileNoNewlineUnitTest.5.inc
[edit]
[-] OneClassPerFileUnitTest.inc
[edit]
[-] LineEndingsUnitTest.1.inc.fixed
[edit]
[-] ByteOrderMarkUnitTest.5.inc
[edit]
[-] LowercasedFilenameUnitTest.php
[edit]
[-] LineEndingsUnitTest.2.inc
[edit]
[-] EndFileNoNewlineUnitTest.1.js.fixed
[edit]
[-] EndFileNewlineUnitTest.2.css
[edit]
[-] EndFileNoNewlineUnitTest.2.inc.fixed
[edit]
[-] EndFileNoNewlineUnitTest.2.js.fixed
[edit]
[-] ExecutableFileUnitTest.2.inc
[edit]
[-] InlineHTMLUnitTest.3.inc
[edit]
[-] EndFileNewlineUnitTest.1.js
[edit]
[-] EndFileNewlineUnitTest.3.css
[edit]
[-] ExecutableFileUnitTest.3.inc
[edit]
[-] LowercasedFilenameUnitTest.2.inc
[edit]
[-] InlineHTMLUnitTest.4.inc
[edit]
[-] ByteOrderMarkUnitTest.2.inc
[edit]
[-] InlineHTMLUnitTest.php
[edit]
[-] LineLengthUnitTest.php
[edit]
[-] EndFileNoNewlineUnitTest.7.inc
[edit]
[-] EndFileNoNewlineUnitTest.8.inc.fixed
[edit]
[-] ByteOrderMarkUnitTest.1.inc
[edit]
[-] ByteOrderMarkUnitTest.4.inc
[edit]
[-] EndFileNewlineUnitTest.2.inc
[edit]
[-] OneClassPerFileUnitTest.php
[edit]
[-] EndFileNoNewlineUnitTest.2.inc
[edit]
[-] LineEndingsUnitTest.js
[edit]
[-] InlineHTMLUnitTest.2.inc
[edit]
[-] lowercased_filename_unit_test.inc
[edit]
[-] EndFileNoNewlineUnitTest.9.inc
[edit]
[-] LineLengthUnitTest.2.inc
[edit]
[-] EndFileNoNewlineUnitTest.1.inc.fixed
[edit]
[-] OneTraitPerFileUnitTest.inc
[edit]
[-] ExecutableFileUnitTest.php
[edit]
[-] EndFileNewlineUnitTest.6.inc.fixed
[edit]
[-] EndFileNoNewlineUnitTest.1.inc
[edit]
[-] EndFileNoNewlineUnitTest.1.js
[edit]
[-] LineEndingsUnitTest.2.inc.fixed
[edit]
[-] EndFileNoNewlineUnitTest.8.inc
[edit]
[-] EndFileNoNewlineUnitTest.6.inc.fixed
[edit]
[-] OneObjectStructurePerFileUnitTest.php
[edit]
[-] EndFileNoNewlineUnitTest.1.css.fixed
[edit]
[-] EndFileNoNewlineUnitTest.2.css.fixed
[edit]
[-] EndFileNewlineUnitTest.8.inc
[edit]
[-] OneObjectStructurePerFileUnitTest.inc
[edit]
[-] EndFileNoNewlineUnitTest.2.css
[edit]
[-] EndFileNoNewlineUnitTest.3.inc
[edit]
[-] LineEndingsUnitTest.1.inc
[edit]
[-] LineEndingsUnitTest.css
[edit]
[-] EndFileNewlineUnitTest.php
[edit]
[-] InlineHTMLUnitTest.6.inc
[edit]
[-] ByteOrderMarkUnitTest.php
[edit]
[-] EndFileNewlineUnitTest.2.js
[edit]
[-] EndFileNewlineUnitTest.3.inc.fixed
[edit]
[-] EndFileNewlineUnitTest.3.inc
[edit]
[-] EndFileNoNewlineUnitTest.4.inc
[edit]
[-] EndFileNewlineUnitTest.5.inc
[edit]
[-] InlineHTMLUnitTest.1.inc
[edit]
[-] EndFileNoNewlineUnitTest.3.js
[edit]
[-] EndFileNewlineUnitTest.1.css
[edit]
[-] EndFileNewlineUnitTest.4.inc.fixed
[edit]
[-] EndFileNoNewlineUnitTest.6.inc
[edit]
[-] EndFileNewlineUnitTest.3.js.fixed
[edit]
[-] EndFileNoNewlineUnitTest.1.css
[edit]
[-] ByteOrderMarkUnitTest.3.inc
[edit]
[-] EndFileNoNewlineUnitTest.3.css
[edit]
[-] LineLengthUnitTest.1.inc
[edit]
[-] LineEndingsUnitTest.css.fixed
[edit]
[-] InlineHTMLUnitTest.7.inc
[edit]
[-] LineLengthUnitTest.3.inc
[edit]
[-] OneInterfacePerFileUnitTest.inc
[edit]
[-] EndFileNoNewlineUnitTest.10.inc
[edit]
[-] LineLengthUnitTest.4.inc
[edit]
[-] EndFileNewlineUnitTest.6.inc
[edit]