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

Move test directory out of package path #168

Merged
merged 10 commits into from
Apr 23, 2020
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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/phpunit.xml.dist export-ignore
/phpunit.circleci.xml export-ignore
/.circleci/ export-ignore
/VariableAnalysis/Tests/ export-ignore
/Tests/ export-ignore

#
# Auto detect text files and perform LF normalization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class BaseTestCase extends TestCase {
const STANDARD_NAME = 'VariableAnalysis';
const SNIFF_FILE = __DIR__ . '/../Sniffs/CodeAnalysis/VariableAnalysisSniff.php';
const SNIFF_FILE = __DIR__ . '/../VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php';

public function prepareLocalFileForSniffs($fixtureFile) {
$config = new Config();
Expand Down Expand Up @@ -41,6 +41,6 @@ public function getErrorLineNumbersFromFile(LocalFile $phpcsFile) {
}

public function getFixture($fixtureFilename) {
return realpath(__DIR__ . '/CodeAnalysis/fixtures/' . $fixtureFilename);
return realpath(__DIR__ . '/VariableAnalysisSniff/fixtures/' . $fixtureFilename);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace VariableAnalysis\Tests\CodeAnalysis;
namespace VariableAnalysis\Tests\VariableAnalysisSniff;

use VariableAnalysis\Tests\BaseTestCase;

Expand Down
3 changes: 3 additions & 0 deletions Tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
require_once(__DIR__ . '/../vendor/squizlabs/php_codesniffer/tests/bootstrap.php');
require_once(__DIR__ . '/BaseTestCase.php');
3 changes: 0 additions & 3 deletions VariableAnalysis/Tests/bootstrap.php

This file was deleted.

5 changes: 5 additions & 0 deletions composer.circleci.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"VariableAnalysis\\": "VariableAnalysis/"
}
},
"autoload-dev": {
"psr-4": {
"VariableAnalysis\\Tests\\": "Tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"VariableAnalysis\\": "VariableAnalysis/"
}
},
"autoload-dev": {
"psr-4": {
"VariableAnalysis\\Tests\\": "Tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
Expand Down
11 changes: 3 additions & 8 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<ruleset name="PaytonsStandard">
<description>
Originally from https://gist.github.com/Ovsyanka/e2ab2ff76e7c0d7e75a1e4213a03ff95
PSR2 with changes:
- bracers on end of line instead new line
- two space indentation
</description>

<file>./VariableAnalysis/</file>
<exclude-pattern>./VariableAnalysis/Tests/CodeAnalysis/fixtures/</exclude-pattern>
<file>./Tests/</file>
<exclude-pattern>./Tests/VariableAnalysisSniff/fixtures/</exclude-pattern>
<exclude-pattern>./vendor/</exclude-pattern>

<!-- Only check PHP files. -->
<arg name="extensions" value="php"/>
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ parameters:
paths:
- %currentWorkingDirectory%/VariableAnalysis/
excludes_analyse:
- %currentWorkingDirectory%/VariableAnalysis/Tests/
- %currentWorkingDirectory%/Tests/
ignoreErrors:
- '~^Constant T_\w+ not found.$~'
4 changes: 2 additions & 2 deletions phpunit.circleci.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<phpunit
bootstrap="VariableAnalysis/Tests/bootstrap.php"
bootstrap="Tests/bootstrap.php"
>
<testsuites>
<testsuite name="VariableAnalysis">
<directory>VariableAnalysis/Tests</directory>
<directory>Tests</directory>
</testsuite>
</testsuites>
</phpunit>
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<phpunit
bootstrap="VariableAnalysis/Tests/bootstrap.php"
bootstrap="Tests/bootstrap.php"
printerClass="LimeDeck\Testing\Printer"
>
<testsuites>
<testsuite name="VariableAnalysis">
<directory>VariableAnalysis/Tests</directory>
<directory>Tests</directory>
</testsuite>
</testsuites>
</phpunit>