Skip to content

Commit 413e91e

Browse files
Fix test namespaces (#3315)
Some of the tests have incorrect namespaces. This PR fixes those discrepancies and reorganizes the contents of the unit test directory.
1 parent 2fe1379 commit 413e91e

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

app/cdash/tests/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ endif()
8383
# Tests from this point to the next cdash_install() are expected to not need database or other
8484
# system resources.
8585

86-
add_unit_test(/Unit/app/ControllerNameTest)
86+
add_unit_test(/Unit/ControllerNameTest)
8787

88-
add_unit_test(/Unit/app/FillableAttributesTest)
88+
add_unit_test(/Unit/FillableAttributesTest)
8989

90-
add_unit_test(/Unit/app/Validators/PasswordTest)
90+
add_unit_test(/Unit/Validators/PasswordTest)
9191

92-
add_unit_test(/Unit/app/Middleware/InternalTest)
92+
add_unit_test(/Unit/Middleware/InternalTest)
9393

9494
# TODO: Is this test useful now?
9595
add_legacy_unit_test(/PHPUnitTest)
@@ -98,7 +98,7 @@ add_legacy_unit_test(/CDash/ServiceContainer)
9898

9999
add_legacy_unit_test(/CDash/LinkifyCompilerOutput)
100100

101-
add_unit_test(/Unit/app/Console/Command/ValidateXmlCommandTest)
101+
add_unit_test(/Unit/Console/Command/ValidateXmlCommandTest)
102102

103103
add_php_test(seconds_from_interval)
104104

phpstan-baseline.neon

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27769,28 +27769,28 @@ parameters:
2776927769
rawMessage: 'You should use assertSame() instead of assertEquals(), because both values are scalars of the same type'
2777027770
identifier: phpunit.assertEquals
2777127771
count: 2
27772-
path: tests/Unit/app/Console/Command/ValidateXmlCommandTest.php
27772+
path: tests/Unit/Console/Command/ValidateXmlCommandTest.php
2777327773

2777427774
-
2777527775
rawMessage: 'Parameter #1 $objectOrClass of class ReflectionClass constructor expects class-string<T of object>|T of object, array<string>|string given.'
2777627776
identifier: argument.type
2777727777
count: 1
27778-
path: tests/Unit/app/ControllerNameTest.php
27778+
path: tests/Unit/ControllerNameTest.php
2777927779

2778027780
-
2778127781
rawMessage: 'Parameter #2 ...$arrays of function array_merge expects array, mixed given.'
2778227782
identifier: argument.type
2778327783
count: 1
27784-
path: tests/Unit/app/ControllerNameTest.php
27784+
path: tests/Unit/ControllerNameTest.php
2778527785

2778627786
-
2778727787
rawMessage: 'Parameter #3 $subject of function str_replace expects array<string>|string, mixed given.'
2778827788
identifier: argument.type
2778927789
count: 1
27790-
path: tests/Unit/app/ControllerNameTest.php
27790+
path: tests/Unit/ControllerNameTest.php
2779127791

2779227792
-
2779327793
rawMessage: 'You should use assertSame() instead of assertEquals(), because both values are scalars of the same type'
2779427794
identifier: phpunit.assertEquals
2779527795
count: 1
27796-
path: tests/Unit/app/Middleware/InternalTest.php
27796+
path: tests/Unit/Middleware/InternalTest.php

tests/Feature/Mail/AuthTokenExpiredTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Tests\Feature\Jobs;
3+
namespace Tests\Feature\Mail;
44

55
use App\Mail\AuthTokenExpired;
66
use App\Models\AuthToken;

tests/Feature/Mail/AuthTokenExpiringTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Tests\Feature\Jobs;
3+
namespace Tests\Feature\Mail;
44

55
use App\Mail\AuthTokenExpiring;
66
use App\Models\AuthToken;

tests/Feature/Submission/Tests/TestXMLTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Tests\Feature\Submission\Instrumentation;
3+
namespace Tests\Feature\Submission\Tests;
44

55
use App\Models\Project;
66
use Tests\TestCase;

tests/Unit/app/Console/Command/ValidateXmlCommandTest.php renamed to tests/Unit/Console/Command/ValidateXmlCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Tests\Feature;
3+
namespace Tests\Unit\Console\Command;
44

55
use Illuminate\Console\Command;
66
use Illuminate\Support\Facades\Artisan;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Tests\Unit\app;
3+
namespace Tests\Unit;
44

55
use Tests\TestCase;
66
use Tests\Traits\IteratesControllers;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Tests\Unit\app;
3+
namespace Tests\Unit;
44

55
use App\Models\User;
66
use Illuminate\Database\Eloquent\MassAssignmentException;

tests/Unit/app/Middleware/InternalTest.php renamed to tests/Unit/Middleware/InternalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Tests\Unit\app\Middleware;
3+
namespace Tests\Unit\Middleware;
44

55
use App\Http\Middleware\Internal;
66
use Illuminate\Http\Request;

tests/Unit/app/Validators/PasswordTest.php renamed to tests/Unit/Validators/PasswordTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
PURPOSE. See the above copyright notices for more information.
1616
=========================================================================*/
1717

18-
namespace App\Validators;
18+
namespace Tests\Unit\Validators;
1919

2020
use App\Validators\Password as PasswordValidator;
2121
use Config;

0 commit comments

Comments
 (0)