Skip to content

Commit

Permalink
Add test case for current strictPSR
Browse files Browse the repository at this point in the history
  • Loading branch information
PrinsFrank committed Apr 30, 2024
1 parent 8286a62 commit d1fb66b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/ClassMapGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ public function testCreateMapDoesNotHitRegexBacktraceLimit(): void
self::assertEqualsNormalized($expected, $result);
}

public function testGetPSR4Violations(): void
{
$this->generator->scanPaths(__DIR__ . '/Fixtures/psrViolations', null, 'psr-4', 'Foo\\');
$classMap = $this->generator->getClassMap();
static::assertSame(
[
'Class Foo\Bar\ClassWithIncorrectSubNamespace located in ./tests/Fixtures/psrViolations/ClassWithIncorrectSubNamespace.php does not comply with psr-4 autoloading standard. Skipping.',
],
$classMap->getPSRViolations()
);
}

/**
* @param array<string, string> $expected
* @param array<class-string, string> $actual
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

namespace Foo\Bar;

class ClassWithIncorrectSubNamespace {}

0 comments on commit d1fb66b

Please sign in to comment.