Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Sep 3, 2023
1 parent c9e0148 commit 5bcff95
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/Core/Autoloader/ReloadWithDifferentCaseTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Tests for the \PHP_CodeSniffer\Autoload::determineLoadedClass method.
*
* @author Juliette Reinders Folmer <phpcs_nospam@adviesenzo.nl>
* @copyright 2006-2023 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/

namespace PHP_CodeSniffer\Tests\Core\Autoloader;

use PHP_CodeSniffer\Autoload;
use PHPUnit\Framework\TestCase;

class ReloadWithDifferentCaseTest extends TestCase
{


/**
* Test.
*
* @return void
*/
public function testNoFatalErrorWhenSecondIncludeUsesDifferentCaseFromFile()
{
// Load the file using the correct class name case first.
$this->assertTrue(Autoload::load('PHP_CodeSniffer\Tests\Core\Autoloader\CaseInsensitive'));

// Now, attempt to load the file a second time, using the incorrect case.
// This should not result in a fatal error.
$this->assertFalse(Autoload::load('PHP_CodeSniffer\Tests\Core\Autoloader\caseinsensitive'));

}//end testNoFatalErrorWhenSecondIncludeUsesDifferentCaseFromFile()


}//end class
3 changes: 3 additions & 0 deletions tests/Core/Autoloader/TestFiles/CaseInsensitive.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
namespace PHP_CodeSniffer\Tests\Core\Autoloader;
class CaseInsensitive {}

0 comments on commit 5bcff95

Please sign in to comment.