Skip to content

Commit 89a0bf6

Browse files
committed
Fix testing namespaces
1 parent 935f4a3 commit 89a0bf6

13 files changed

+35
-33
lines changed

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
}
4141
},
4242
"autoload-dev": {
43-
"classmap": ["tests/src"]
43+
"psr-4": {
44+
"mglaman\\PHPStanDrupal\\Tests\\": "tests/src/"
45+
}
4446
},
4547
"extra": {
4648
"branch-alias": {

tests/src/AnalyzerTestBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace mglaman\PHPStanDrupal\Drupal;
3+
namespace mglaman\PHPStanDrupal\Tests;
44

55
use Drupal\Core\DependencyInjection\ContainerNotInitializedException;
66
use PHPStan\Analyser\Analyser;

tests/src/BootstrapTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace mglaman\PHPStanDrupal\Drupal;
3+
namespace mglaman\PHPStanDrupal\Tests;
44

55
use Drupal\Core\DependencyInjection\ContainerNotInitializedException;
66
use PHPStan\DependencyInjection\ContainerFactory;

tests/src/DeprecationRulesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace mglaman\PHPStanDrupal\Drupal;
3+
namespace mglaman\PHPStanDrupal\Tests;
44

55
class DeprecationRulesTest extends AnalyzerTestBase
66
{

tests/src/DrupalIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace mglaman\PHPStanDrupal\Drupal;
3+
namespace mglaman\PHPStanDrupal\Tests;
44

55
use PHPStan\Analyser\Error;
66

tests/src/DrushIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace mglaman\PHPStanDrupal\Drupal;
3+
namespace mglaman\PHPStanDrupal\Tests;
44

55
final class DrushIntegrationTest extends AnalyzerTestBase
66
{

tests/src/EntityTestClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace mglaman\PHPStanDrupal\Drupal;
3+
namespace mglaman\PHPStanDrupal\Tests;
44

55
final class EntityTestClass extends AnalyzerTestBase
66
{

tests/src/EntityTypeManagerGetStorageDynamicReturnTypeExtensionTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22

3-
namespace mglaman\PHPStanDrupal\Drupal;
3+
namespace mglaman\PHPStanDrupal\Tests;
44

5+
use mglaman\PHPStanDrupal\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension;
56
use PhpParser\Node\Arg;
67
use PhpParser\Node\Expr;
78
use PhpParser\Node\Expr\MethodCall;
@@ -10,7 +11,6 @@
1011
use PHPStan\Reflection\MethodReflection;
1112
use PHPStan\Reflection\ParametersAcceptor;
1213
use PHPStan\ShouldNotHappenException;
13-
use PHPStan\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension;
1414
use PHPStan\Type\ObjectType;
1515
use PHPUnit\Framework\TestCase;
1616
use Prophecy\Prophet;
@@ -32,10 +32,10 @@ protected function setUp(): void
3232
}
3333

3434
/**
35-
* @covers \PHPStan\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::__construct
36-
* @covers \PHPStan\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::getClass
35+
* @covers \mglaman\PHPStanDrupal\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::__construct
36+
* @covers \mglaman\PHPStanDrupal\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::getClass
3737
*/
38-
public function testGetClass()
38+
public function testGetClass(): void
3939
{
4040
$x = new EntityTypeManagerGetStorageDynamicReturnTypeExtension([]);
4141
self::assertEquals('Drupal\Core\Entity\EntityTypeManagerInterface', $x->getClass());
@@ -44,10 +44,10 @@ public function testGetClass()
4444
/**
4545
* @dataProvider getEntityStorageProvider
4646
*
47-
* @covers \PHPStan\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::__construct
48-
* @covers \PHPStan\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::getTypeFromMethodCall
47+
* @covers \mglaman\PHPStanDrupal\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::__construct
48+
* @covers \mglaman\PHPStanDrupal\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::getTypeFromMethodCall
4949
*/
50-
public function testGetTypeFromMethodCall($entityType, $storageClass)
50+
public function testGetTypeFromMethodCall($entityType, $storageClass): void
5151
{
5252
// If we were passed a string, assume it is a class name to be mocked.
5353
if (is_string($entityType)) {
@@ -106,10 +106,10 @@ public function getEntityStorageProvider(): \Iterator
106106
}
107107

108108
/**
109-
* @covers \PHPStan\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::__construct
110-
* @covers \PHPStan\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::isMethodSupported
109+
* @covers \mglaman\PHPStanDrupal\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::__construct
110+
* @covers \mglaman\PHPStanDrupal\Type\EntityTypeManagerGetStorageDynamicReturnTypeExtension::isMethodSupported
111111
*/
112-
public function testIsMethodSupported()
112+
public function testIsMethodSupported(): void
113113
{
114114
$x = new EntityTypeManagerGetStorageDynamicReturnTypeExtension([]);
115115

tests/src/Rules/BrowserTestBaseDefaultThemeRuleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php declare(strict_types=1);
22

3-
namespace PHPStan\Drupal\Rules;
3+
namespace mglaman\PHPStanDrupal\Tests\Rules;
44

5-
use PHPStan\Drupal\AnalyzerTestBase;
5+
use mglaman\PHPStanDrupal\Tests\AnalyzerTestBase;
66

77
final class BrowserTestBaseDefaultThemeRuleTest extends AnalyzerTestBase {
88

tests/src/Rules/ConfigEntityConfigExportRuleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php declare(strict_types=1);
22

3-
namespace PHPStan\Drupal\Rules;
3+
namespace mglaman\PHPStanDrupal\Tests\Rules;
44

5-
use PHPStan\Drupal\AnalyzerTestBase;
5+
use mglaman\PHPStanDrupal\Tests\AnalyzerTestBase;
66

77
final class ConfigEntityConfigExportRuleTest extends AnalyzerTestBase {
88

0 commit comments

Comments
 (0)