-
Notifications
You must be signed in to change notification settings - Fork 64
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
Fix running tests of framework #7
Comments
I had to do this on my project. I decided to abandon the |
Hey @ryantxr This is exactly what I do in my side project too 😊 I gave up on using My initial idea of this issue is to be able to test framework itself with its tests. Currently here we're just patching Cake to meet PHP8 requirements but I rely on tests from my side project. No idea if tests are passing. I already spend sometime on this problem but gave up after I saw how tangled tests are to "Cake's way" of testing. Any idea how could we approach it with minimal effort? |
@kamilwylegala I don't know about minimal. There are two major challenges.
I also autoload using composer. I think this is necessary to get it all working. This requires adding composer autoloader in app/Config/bootstrap.php. This also allows me to add new classes and load using |
@ryantxr I'm interested in your progress, care to share? NB: My fork is here: https://github.com/mevdschee/cakephp2-php8 |
Hi! I forked this repository to private and tried to see if I could run the test with GitHub Actions. I also prepared a commit in the public repository.
I want to create a pull request, but how do I create it?
|
Hey @tenkoma I briefly checked the code. Great job! 😊 I also created merge request: https://github.com/kamilwylegala/cakephp2-php8/pull/23/files . I will review your code this week. It includes all commits that you created in |
Yes, I would like to have the git history kept. |
I used Docker Compose on my work PC to create a working environment, so I will share the configuration files. Added: 2023/02/05 PostgreSQL/SQLite added
docker compose up -d
docker compose exec web composer install
docker compose exec web ./vendors/bin/phpunit --stderr --verbose lib/Cake/Test/Case/AllTestsTest.php contents of docker-compose.yml, docker/web/Dockerfile, docker/mysql/1_initialize_database.sql, docker/pgsql/1_initialize_database.sql
|
Thanks for docker compose scripts. I think it's worth to include them in repository too. |
Docker compose setup works like charm 😊 I only get these failures:
But I think we can proceed with the PR and focus on these tests in the future. I will also extend readme about tests and commit your setup of |
Merged to master. Closing 😊 |
#7 (comment) |
Cake's test relay hevily on
PHPUnit_Test_Case
class which comes from old version of PHPUnit.each()
used which is removed in PHP 8.Bootstrap file
Check if it helps to run tests of framework: cakephp/cakephp#12700 (comment)
The text was updated successfully, but these errors were encountered: