Skip to content

Commit

Permalink
Merge pull request phpmyadmin#18818 from MauricioFauth/tests-dir
Browse files Browse the repository at this point in the history
Move test directory to tests
  • Loading branch information
MauricioFauth authored Nov 30, 2023
2 parents 46cc682 + 1d1c55e commit 803fbc1
Show file tree
Hide file tree
Showing 479 changed files with 770 additions and 770 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ indent_size = 2
[*.svg]
insert_final_newline = false

[test/test_data/*]
[tests/test_data/*]
insert_final_newline = false
18 changes: 9 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ psalm.xml export-ignore
psalm-baseline.xml export-ignore
DCO export-ignore
.editorconfig export-ignore
# Exclude only the following files and not all files in test/
# Exclude only the following files and not all files in tests/
# This is because some packaging teams need our test files but not the CI related files
test/doctum-config.php export-ignore
test/bootstrap-static.php export-ignore
test/config.e2e.inc.php export-ignore
test/phpstan-constants.php export-ignore
test/*-local-server export-ignore
test/*.conf export-ignore
test/*.ini export-ignore
test/ci-phplint export-ignore
tests/doctum-config.php export-ignore
tests/bootstrap-static.php export-ignore
tests/config.e2e.inc.php export-ignore
tests/phpstan-constants.php export-ignore
tests/*-local-server export-ignore
tests/*.conf export-ignore
tests/*.ini export-ignore
tests/ci-phplint export-ignore
.browserslistrc export-ignore
CODE_OF_CONDUCT.md export-ignore
CONTRIBUTING.md export-ignore
2 changes: 1 addition & 1 deletion .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
paths:
- 'resources/js/**'
- '**.s?css'
- 'test/javascript/**'
- 'tests/javascript/**'
- '.browserslistrc'
- '.eslint*'
- '*.cjs'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-and-analyse-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Lint PHP files
# Allow the previous check to fail but not abort
if: always()
run: ./test/ci-phplint
run: ./tests/ci-phplint

- name: Check coding-standard
# Allow the previous check to fail but not abort
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
- name: Lint phpdoc blocks
uses: sudo-bot/action-doctum@v5
with:
config-file: test/doctum-config.php
config-file: tests/doctum-config.php
method: "parse"
cli-args: "--output-format=github --no-ansi --no-progress -v --ignore-parse-errors"
4 changes: 2 additions & 2 deletions .github/workflows/mutation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:
- master
paths:
- 'src/**.php'
- 'test/classes/**.php'
- 'tests/classes/**.php'
pull_request:
branches:
- master
paths:
- 'src/**.php'
- 'test/classes/**.php'
- 'tests/classes/**.php'
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test-selenium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ jobs:
run: yarn install --non-interactive --production

- name: Copy the config
run: cp test/config.e2e.inc.php config.inc.php
run: cp tests/config.e2e.inc.php config.inc.php

- name: Start server
env:
CI_MODE: selenium
FPM_PATH: php-fpm${{ env.php-version }}
SKIP_STANDALONE: 1
run: |
./test/start-local-server
./tests/start-local-server
echo "SELENIUM_TEMPDIR=$(cat /tmp/last_temp_dir_phpMyAdminTests)" >> $GITHUB_OUTPUT
id: start-local-server

Expand All @@ -131,12 +131,12 @@ jobs:
TESTSUITE_SELENIUM_BROWSER: chrome
TESTSUITE_USER: root
TESTSUITE_PASSWORD: testbench
# Port defined in test/nginx.conf
# Port defined in tests/nginx.conf
TESTSUITE_URL: http://docker-host-bridge:8000
TESTSUITE_DATABASE_PREFIX: "selenium"
TESTSUITE_SELENIUM_HOST: "127.0.0.1"
TESTSUITE_SELENIUM_PORT: "4444"
run: ./vendor/bin/phpunit --testsuite selenium --no-logging --no-coverage --stop-on-skipped --testdox test/selenium/${{ matrix.test-name }}Test.php
run: ./vendor/bin/phpunit --testsuite selenium --no-logging --no-coverage --stop-on-skipped --testdox tests/selenium/${{ matrix.test-name }}Test.php

- name: Output logs and stop server
env:
Expand All @@ -146,7 +146,7 @@ jobs:
run: |
if [ -f "${SELENIUM_TEMPDIR}/php.log" ] ; then cat "${SELENIUM_TEMPDIR}/php.log" ; fi
if [ -f "${SELENIUM_TEMPDIR}/nginx-error.log" ] ; then cat "${SELENIUM_TEMPDIR}/nginx-error.log" ; fi
./test/stop-local-server
./tests/stop-local-server
- name: Upload screenshots
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ phpcs.xml
.phpcs-cache
# PHPUnit
phpunit.xml
/test/bootstrap.php
/tests/bootstrap.php
.phpunit.result.cache
# Jenkins
/build/
Expand Down
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ filter:
- public/js/
- tmp/
- vendor/
- test/doctum-config.php
- tests/doctum-config.php
checks:
javascript: true
php: true
Expand Down
4 changes: 2 additions & 2 deletions bin/internal/create-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ rm -r .github CODE_OF_CONDUCT.md DCO
rm .scrutinizer.yml .weblate codecov.yml

# Remove Doctum config file
rm test/doctum-config.php
rm tests/doctum-config.php

# Remove readme for github
rm README.rst
Expand Down Expand Up @@ -606,7 +606,7 @@ for kit in $KITS ; do
if [ "$kit" != source ] ; then
echo "* Removing source files"
# Testsuite
rm -r test/
rm -r tests/
# Template test files
rm -r resources/templates/test/
rm phpunit.xml.*
Expand Down
2 changes: 1 addition & 1 deletion bin/update-po
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ php bin/console cache:warmup --twig-po --env development
# Update pot (template), ensure that advisor is at the end
LOCS=$(find po -name '*.po' | sed 's@.*/\(.*\)\.po@\1@')

find . -name '*.php' -not -path './test/*' -not -path './po/*' -not -path './tmp/*' -not -path './release/*' -not -path './node_modules/*' -not -path './vendor/*' > twig-templates/filesList
find . -name '*.php' -not -path './tests/*' -not -path './po/*' -not -path './tmp/*' -not -path './release/*' -not -path './node_modules/*' -not -path './vendor/*' > twig-templates/filesList

php ./bin/match-twig-cache
sort --dictionary-order --ignore-case --output ./twig-templates/filesListTemp < ./twig-templates/filesList
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"PhpMyAdmin\\": "src"
},
"exclude-from-classmap": [
"/test/",
"/tests/",
"/vendor/tecnickcom/tcpdf/tcpdf_barcodes_*.php",
"/vendor/tecnickcom/tcpdf/tcpdf_import.php",
"/vendor/tecnickcom/tcpdf/tcpdf_parser.php",
Expand All @@ -36,8 +36,8 @@
},
"autoload-dev": {
"psr-4": {
"PhpMyAdmin\\Tests\\": "test/classes",
"PhpMyAdmin\\Tests\\Selenium\\": "test/selenium/"
"PhpMyAdmin\\Tests\\": "tests/classes",
"PhpMyAdmin\\Tests\\Selenium\\": "tests/selenium/"
}
},
"repositories": [
Expand Down
2 changes: 1 addition & 1 deletion doc/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ are always ways to make your installation more secure:
* Ensure your PHP setup follows recommendations for production sites, for example
`display_errors <https://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors>`_
should be disabled.
* Remove the ``test`` directory from phpMyAdmin, unless you are developing and need a test suite.
* Remove the ``tests`` directory from phpMyAdmin, unless you are developing and need a test suite.
* Remove the ``setup`` directory from phpMyAdmin, you will probably not
use it after the initial setup.
* Properly choose an authentication method - :ref:`cookie`
Expand Down
2 changes: 1 addition & 1 deletion jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
'<rootDir>/public/js/vendor/',
],
displayName: 'phpMyAdmin',
testMatch: ['<rootDir>/test/javascript/**/*.ts'],
testMatch: ['<rootDir>/tests/javascript/**/*.ts'],
transform: { '\\.[jt]sx?$': 'babel-jest' },
moduleNameMapper: {
'^phpmyadmin/(.*)$': '<rootDir>/resources/js/src/$1',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"postinstall": "yarn run build",
"build": "webpack",
"css-lint": "stylelint \"public/themes/**/scss/*.scss\" \"public/setup/scss/*.scss\"",
"js-lint": "eslint resources/js/src test/javascript jest.config.cjs",
"js-lint": "eslint resources/js/src tests/javascript jest.config.cjs",
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
}
}
4 changes: 2 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
<file>./examples</file>
<file>./public</file>
<file>./src</file>
<file>./test</file>
<file>./tests</file>
<file>./config.sample.inc.php</file>

<exclude-pattern>*/app/cache/*</exclude-pattern>
<exclude-pattern>*/app/language_stats.inc.php</exclude-pattern>
<exclude-pattern>*/build/*</exclude-pattern>
<exclude-pattern>*/config.inc.php</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/test/doctum-config.php</exclude-pattern>
<exclude-pattern>*/tests/doctum-config.php</exclude-pattern>
<exclude-pattern>*/tmp/*</exclude-pattern>
<exclude-pattern>*/twig-templates/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
Expand Down
Loading

0 comments on commit 803fbc1

Please sign in to comment.