Feature #22666
closedRename the test cases from *_testcase to *Test
0%
Description
The testcases was named like regularexpression_testcase.php back in the
good old days, when Robert Lemke started with using PHPUnit for TYPO3.
The appendix _testcase was used as a keyword for finding all files with
test cases by the extension phpunit [1]. This works fine, if you call
the files from inside the Backend with phpunit, but for various reasons
(e.g. Continous Integration) you have to call the tests from CLI with
the cli_dispatcher.
In this context phpunit extension pass the given arguements to PHPUnit
[2], where the test executed at the end.
But PHPUnit from Sebastian Bergmann looks for files with *Test.php if
you call it like:
phpunit --some-args tests/
So it never will find any file/test in tests/ and phpunit also won´t if
you call it from CLI.
Solution:
Rename the files and classes
[1] http://forge.typo3.org/projects/show/extension-phpunit
[2] http://www.phpunit.de/
[3] http://typo3.org/extensions/repository/view/phpunit/current/
[4] https://svn.typo3.org/TYPO3v4/Extensions/phpunit/
1) Get a phpunit version lower than 3.4.12 from TER [3] or SVN [4]
2) Create a BE-User called: _cli_phpunit
3) open a CLI inside a working T3 installation on root level
4) call the cli_dispatcher by this command:
php typo3/cli_dispatch.phpsh phpunit tests/
How to test:
1) Get the current version of phpunit from TER [3] or SVN [4]
2) Create a BE-User called: _cli_phpunit
3) apply the patch / rename the files and classes
4) open a CLI inside a working T3 installation on root level
5) call the cli_dispatcher by this command:
php typo3/cli_dispatch.phpsh phpunit tests/
(issue imported from #M14405)
Files
Updated by Christian Kuhn over 14 years ago
rev. 7872: Rename files in tests/
rev. 7873: Rename classes in tests/
rev. 7874: Rename test files in typo3/sysext/
rev. 7875: Rename test classes in typo3/sysext/
rev. 7876: Remove empty tests/ext dir, ext tests are in their ext directories