Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge test libs dir into src #227

Merged
merged 2 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
"autoload": {
"psr-4": {"Spaze\\PHPStan\\Rules\\Disallowed\\": "src"}
},
"autoload-dev": {
"classmap": ["tests/src"]
},
"scripts": {
"lint": "vendor/bin/parallel-lint --colors src/ tests/",
"lint-7.x": "vendor/bin/parallel-lint --colors src/ tests/ --exclude tests/src/TypesEverywhere.php --exclude tests/src/disallowed/functionCallsNamedParams.php --exclude tests/src/disallowed-allow/functionCallsNamedParams.php --exclude tests/src/disallowed/attributeUsages.php --exclude tests/src/disallowed-allow/attributeUsages.php",
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
<exclude name="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall" />
<exclude name="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration" />
</rule>
<exclude-pattern>tests/libs/</exclude-pattern>
<exclude-pattern>tests/src/</exclude-pattern>
</ruleset>
29 changes: 0 additions & 29 deletions tests/BootstrapTest.php

This file was deleted.

2 changes: 1 addition & 1 deletion tests/Calls/FunctionCallsAllowInFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function getRule(): Rule
public function testRule(): void
{
// Based on the configuration above, in this file:
$this->analyse([__DIR__ . '/../libs/Functions.php'], [
$this->analyse([__DIR__ . '/../src/Functions.php'], [
[
// expect this error message:
'Calling sha1() is forbidden. [sha1() matches sha*()]',
Expand Down
2 changes: 1 addition & 1 deletion tests/Calls/FunctionCallsAllowInMethodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function getRule(): Rule
public function testRule(): void
{
// Based on the configuration above, in this file:
$this->analyse([__DIR__ . '/../libs/Royale.php'], [
$this->analyse([__DIR__ . '/../src/Royale.php'], [
[
// expect this error message:
'Calling sha1() is forbidden.',
Expand Down
4 changes: 2 additions & 2 deletions tests/Calls/FunctionCallsDefinedInTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ protected function getRule(): Rule
[
[
'function' => '\\Foo\\Bar\\Waldo\\f*()',
'definedIn' => __DIR__ . '/../libs/Fun*.php',
'definedIn' => __DIR__ . '/../src/Fun*.php',
'allowIn' => [
__DIR__ . '/../src/disallowed-allow/*.php',
__DIR__ . '/../src/*-allow/*.*',
],
],
[
'function' => '\\Foo\\Bar\\Waldo\\b*()',
'definedIn' => __DIR__ . '/../libs/ThisFileDoesNotExist.php',
'definedIn' => __DIR__ . '/../src/ThisFileDoesNotExist.php',
'allowIn' => [
__DIR__ . '/../src/disallowed-allow/*.php',
__DIR__ . '/../src/*-allow/*.*',
Expand Down
2 changes: 1 addition & 1 deletion tests/Calls/MethodCallsDefinedInTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function getRule(): Rule
[
[
'method' => '*',
'definedIn' => __DIR__ . '/../libs/Bl*',
'definedIn' => __DIR__ . '/../src/Bl*',
'allowIn' => [
__DIR__ . '/../src/disallowed-allow/*.php',
__DIR__ . '/../src/*-allow/*.*',
Expand Down
2 changes: 1 addition & 1 deletion tests/Calls/NewCallsDefinedInTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function getRule(): Rule
[
[
'method' => '*',
'definedIn' => __DIR__ . '/../libs/Bl*',
'definedIn' => __DIR__ . '/../src/Bl*',
'allowIn' => [
__DIR__ . '/../src/disallowed-allow/*.php',
__DIR__ . '/../src/*-allow/*.*',
Expand Down
14 changes: 0 additions & 14 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,3 @@
declare(strict_types = 1);

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/libs/AttributeClass.php';
require __DIR__ . '/libs/AttributeEntity.php';
require __DIR__ . '/libs/Bar.php';
require __DIR__ . '/libs/Blade.php';
require __DIR__ . '/libs/Constructor.php';
require __DIR__ . '/libs/Functions.php';
require __DIR__ . '/libs/Inheritance.php';
require __DIR__ . '/libs/Interfaces.php';
require __DIR__ . '/libs/Option.php';
require __DIR__ . '/libs/Royale.php';
require __DIR__ . '/libs/SomeInterface.php';
require __DIR__ . '/libs/TestException.php';
require __DIR__ . '/libs/TestTrait.php';
require __DIR__ . '/libs/Traits.php';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.