Unverified Commit 61629103 authored by Sergei Morozov's avatar Sergei Morozov Committed by GitHub

Merge pull request #3915 from morozov/psr-4

Flatten source and test directory structure
parents 40cc9bd5 9ba851ec
......@@ -127,9 +127,9 @@ before_test:
test_script:
- ps: >-
if ($env:db_version) {
$env:phpunit_config = "tests\appveyor\$($env:db).$($env:db_version).$($env:driver).appveyor.xml"
$env:phpunit_config = "ci\appveyor\$($env:db).$($env:db_version).$($env:driver).appveyor.xml"
} else {
$env:phpunit_config = "tests\appveyor\$($env:db).$($env:driver).appveyor.xml"
$env:phpunit_config = "ci\appveyor\$($env:db).$($env:driver).appveyor.xml"
}
if ($env:coverage -eq "yes") {
......
......@@ -17,7 +17,7 @@ before_script:
- |
if [[ -n "$IMAGE" ]]
then
bash ./tests/travis/docker-run-mysql-or-mariadb.sh
bash ./ci/travis/docker-run-mysql-or-mariadb.sh
fi
install:
......@@ -30,9 +30,9 @@ install:
script:
- |
if [ "x$COVERAGE" == "xyes" ]; then
./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml --coverage-clover clover.xml
./vendor/bin/phpunit --configuration ci/travis/$DB.travis.xml --coverage-clover clover.xml
else
./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml
./vendor/bin/phpunit --configuration ci/travis/$DB.travis.xml
fi
after_script:
......@@ -117,36 +117,36 @@ jobs:
addons:
postgresql: "10"
before_script:
- bash ./tests/travis/install-postgres-10.sh
- bash ./ci/travis/install-postgres-10.sh
- stage: Test
php: 7.3
env: DB=pgsql POSTGRESQL_VERSION=11.0 COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-postgres-11.sh
- bash ./ci/travis/install-postgres-11.sh
- stage: Test
php: 7.3
env: DB=sqlsrv COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-sqlsrv-dependencies.sh
- bash ./tests/travis/install-mssql-sqlsrv.sh
- bash ./tests/travis/install-mssql.sh
- bash ./ci/travis/install-sqlsrv-dependencies.sh
- bash ./ci/travis/install-mssql-sqlsrv.sh
- bash ./ci/travis/install-mssql.sh
- stage: Test
php: 7.3
env: DB=pdo_sqlsrv COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-sqlsrv-dependencies.sh
- bash ./tests/travis/install-mssql-pdo_sqlsrv.sh
- bash ./tests/travis/install-mssql.sh
- bash ./ci/travis/install-sqlsrv-dependencies.sh
- bash ./ci/travis/install-mssql-pdo_sqlsrv.sh
- bash ./ci/travis/install-mssql.sh
- stage: Test
php: 7.3
env: DB=ibm_db2 COVERAGE=yes
sudo: required
before_script:
- bash ./tests/travis/install-db2.sh
- bash ./tests/travis/install-db2-ibm_db2.sh
- bash ./ci/travis/install-db2.sh
- bash ./ci/travis/install-db2-ibm_db2.sh
- stage: Test
php: 7.3
env: DB=sqlite DEPENDENCIES=low
......@@ -169,7 +169,7 @@ jobs:
env: DB=pgsql POSTGRESQL_VERSION=11.0
sudo: required
before_script:
- bash ./tests/travis/install-postgres-11.sh
- bash ./ci/travis/install-postgres-11.sh
- stage: Test
php: 7.4
env: DB=sqlite
......@@ -178,17 +178,17 @@ jobs:
env: DB=sqlsrv
sudo: required
before_script:
- bash ./tests/travis/install-sqlsrv-dependencies.sh
- bash ./tests/travis/install-mssql-sqlsrv.sh
- bash ./tests/travis/install-mssql.sh
- bash ./ci/travis/install-sqlsrv-dependencies.sh
- bash ./ci/travis/install-mssql-sqlsrv.sh
- bash ./ci/travis/install-mssql.sh
- stage: Test
php: 7.4
env: DB=pdo_sqlsrv
sudo: required
before_script:
- bash ./tests/travis/install-sqlsrv-dependencies.sh
- bash ./tests/travis/install-mssql-pdo_sqlsrv.sh
- bash ./tests/travis/install-mssql.sh
- bash ./ci/travis/install-sqlsrv-dependencies.sh
- bash ./ci/travis/install-mssql-pdo_sqlsrv.sh
- bash ./ci/travis/install-mssql.sh
- stage: Test
php: nightly
......@@ -207,7 +207,7 @@ jobs:
env: DB=pgsql POSTGRESQL_VERSION=11.0
sudo: required
before_script:
- bash ./tests/travis/install-postgres-11.sh
- bash ./ci/travis/install-postgres-11.sh
- stage: Test
php: nightly
env: DB=sqlite
......@@ -216,17 +216,17 @@ jobs:
env: DB=sqlsrv
sudo: required
before_script:
- bash ./tests/travis/install-sqlsrv-dependencies.sh
- bash ./tests/travis/install-mssql-sqlsrv.sh
- bash ./tests/travis/install-mssql.sh
- bash ./ci/travis/install-sqlsrv-dependencies.sh
- bash ./ci/travis/install-mssql-sqlsrv.sh
- bash ./ci/travis/install-mssql.sh
- stage: Test
php: nightly
env: DB=pdo_sqlsrv
sudo: required
before_script:
- bash ./tests/travis/install-sqlsrv-dependencies.sh
- bash ./tests/travis/install-mssql-pdo_sqlsrv.sh
- bash ./tests/travis/install-mssql.sh
- bash ./ci/travis/install-sqlsrv-dependencies.sh
- bash ./ci/travis/install-mssql-pdo_sqlsrv.sh
- bash ./ci/travis/install-mssql.sh
- stage: Test
if: type = cron
......
......@@ -27,13 +27,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -27,13 +27,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -27,13 +27,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -27,13 +27,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -29,13 +29,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -27,13 +27,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -27,13 +27,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -26,13 +26,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -26,13 +26,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -26,13 +26,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -26,13 +26,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -26,13 +26,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -26,13 +26,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -13,13 +13,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -26,13 +26,13 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>../Doctrine/Tests/DBAL</directory>
<directory>../../tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">../../lib/Doctrine</directory>
<directory suffix=".php">../../src</directory>
</whitelist>
</filter>
......
......@@ -55,10 +55,10 @@
"sort-packages": true
},
"autoload": {
"psr-4": { "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" }
"psr-4": { "Doctrine\\DBAL\\": "src" }
},
"autoload-dev": {
"psr-4": { "Doctrine\\Tests\\": "tests/Doctrine/Tests" }
"psr-4": { "Doctrine\\DBAL\\Tests\\": "tests" }
},
"extra": {
"branch-alias": {
......
......@@ -47,4 +47,4 @@ object is closed:
.. warning::
When using the cache layer not all fetch modes are supported. See the code of the `ResultCacheStatement <https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Cache/ResultCacheStatement.php>`_ for details.
When using the cache layer not all fetch modes are supported. See the code of the `ResultCacheStatement <https://github.com/doctrine/dbal/blob/master/src/Cache/ResultCacheStatement.php>`_ for details.
......@@ -15,12 +15,12 @@ For an already supported platform but unsupported driver you only
need to implement the first three interfaces, since the SQL
Generation and Schema Management is already supported by the
respective platform and schema instances. You can also make use of
several Abstract Unittests in the ``\Doctrine\Tests\DBAL`` package
several Abstract Unittests in the ``\Doctrine\DBAL\Tests`` package
to check if your platform behaves like all the others which is
necessary for SchemaTool support, namely:
- ``\Doctrine\Tests\DBAL\Platforms\AbstractPlatformTestCase``
- ``\Doctrine\Tests\DBAL\Functional\Schema\AbstractSchemaManagerTestCase``
- ``\Doctrine\DBAL\Tests\Platforms\AbstractPlatformTestCase``
- ``\Doctrine\DBAL\Tests\Functional\Schema\AbstractSchemaManagerTestCase``
We would be very happy if any support for new databases would be
contributed back to Doctrine to make it an even better product.
......
......@@ -10,7 +10,7 @@
<arg value="nps"/>
<file>bin</file>
<file>lib</file>
<file>src</file>
<file>tests</file>
<rule ref="Doctrine">
......@@ -22,11 +22,11 @@
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint">
<exclude-pattern>*/lib/*</exclude-pattern>
<exclude-pattern>*/src/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint">
<exclude-pattern>*/lib/*</exclude-pattern>
<exclude-pattern>*/src/*</exclude-pattern>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
......@@ -38,51 +38,51 @@
</rule>
<rule ref="Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase">
<exclude-pattern>lib/Doctrine/DBAL/Events.php</exclude-pattern>
<exclude-pattern>src/Events.php</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedProperty">
<exclude-pattern>tests/Doctrine/Tests/DBAL/Tools/TestAsset/*</exclude-pattern>
<exclude-pattern>tests/Tools/TestAsset/*</exclude-pattern>
</rule>
<!-- see https://github.com/squizlabs/PHP_CodeSniffer/issues/2099 -->
<rule ref="Squiz.Commenting.FunctionComment.InvalidNoReturn">
<exclude-pattern>lib/Doctrine/DBAL/Platforms/AbstractPlatform.php</exclude-pattern>
<exclude-pattern>lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php</exclude-pattern>
<exclude-pattern>tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php</exclude-pattern>
<exclude-pattern>src/Platforms/AbstractPlatform.php</exclude-pattern>
<exclude-pattern>src/Schema/AbstractSchemaManager.php</exclude-pattern>
<exclude-pattern>tests/Platforms/AbstractPlatformTestCase.php</exclude-pattern>
</rule>
<!-- some statement classes close cursor using an empty while-loop -->
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedWhile">
<exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
<exclude-pattern>src/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
</rule>
<!-- sqlsrv functions are documented in upper case but reflected in lower case -->
<rule ref="Squiz.PHP.LowercasePHPFunctions.CallUppercase">
<exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
<exclude-pattern>src/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
</rule>
<!-- see https://github.com/squizlabs/PHP_CodeSniffer/issues/2165 -->
<rule ref="Squiz.Arrays.ArrayDeclaration.SpaceBeforeComma">
<exclude-pattern>tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php</exclude-pattern>
<exclude-pattern>tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php</exclude-pattern>
<exclude-pattern>tests/Platforms/OraclePlatformTest.php</exclude-pattern>
<exclude-pattern>tests/SQLParserUtilsTest.php</exclude-pattern>
</rule>
<!-- see https://github.com/doctrine/dbal/issues/3377 -->
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators.DisallowedNotEqualOperator">
<exclude-pattern>lib/Doctrine/DBAL/Schema/Comparator.php</exclude-pattern>
<exclude-pattern>src/Schema/Comparator.php</exclude-pattern>
</rule>
<!-- see https://github.com/slevomat/coding-standard/issues/737 -->
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.IncorrectReturnTypeHint">
<exclude-pattern>lib/Doctrine/DBAL/Types/ArrayType.php</exclude-pattern>
<exclude-pattern>lib/Doctrine/DBAL/Types/ObjectType.php</exclude-pattern>
<exclude-pattern>tests/Doctrine/Tests/DBAL/Driver/Mysqli/MysqliConnectionTest.php</exclude-pattern>
<exclude-pattern>src/Types/ArrayType.php</exclude-pattern>
<exclude-pattern>src/Types/ObjectType.php</exclude-pattern>
<exclude-pattern>tests/Driver/Mysqli/MysqliConnectionTest.php</exclude-pattern>
</rule>
<!-- The SQLSRV_* functions are defined in the upper case by the sqlsrv extension and violate the standard
see https://docs.microsoft.com/en-us/sql/connect/php/constants-microsoft-drivers-for-php-for-sql-server -->
<rule ref="Squiz.PHP.LowercasePHPFunctions.UseStatementUppercase">
<exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
<exclude-pattern>src/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
</rule>
</ruleset>
parameters:
level: 7
paths:
- %currentWorkingDirectory%/lib
- %currentWorkingDirectory%/src
autoload_files:
- %currentWorkingDirectory%/tests/phpstan-polyfill.php
reportUnmatchedIgnoredErrors: false
......
......@@ -44,22 +44,22 @@
<testsuites>
<testsuite name="Doctrine DBAL Test Suite">
<directory>./tests/Doctrine/Tests/DBAL</directory>
<exclude>./tests/Doctrine/Tests/DBAL/Performance</exclude>
<directory>./tests</directory>
<exclude>./tests/Performance</exclude>
</testsuite>
<testsuite name="Doctrine DBAL Performance Test Suite">
<directory>./tests/Doctrine/Tests/DBAL/Performance</directory>
<directory>./tests/Performance</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">lib/Doctrine</directory>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<listeners>
<listener class="Doctrine\Tests\DbalPerformanceTestListener"/>
<listener class="Doctrine\DBAL\Tests\PerformanceTestListener"/>
</listeners>
<groups>
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment