This tutorial uses PHPUnit 9 but works just fine for PHPUnit 10.
// composer.json
{
"require": {
"php": ">=8.1.0",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/doctrine-bundle": "^2.8", // 2.10.2
"doctrine/doctrine-migrations-bundle": "^3.2", // 3.2.4
"doctrine/orm": "^2.14", // 2.16.2
"symfony/asset": "6.3.*", // v6.3.0
"symfony/console": "6.3.*", // v6.3.4
"symfony/dotenv": "6.3.*", // v6.3.0
"symfony/flex": "^2", // v2.3.3
"symfony/framework-bundle": "6.3.*", // v6.3.5
"symfony/http-client": "6.3.*", // v6.3.5
"symfony/mailer": "6.3.*", // v6.3.5
"symfony/messenger": "6.3.*", // v6.3.5
"symfony/monolog-bundle": "^3.0", // v3.8.0
"symfony/runtime": "6.3.*", // v6.3.2
"symfony/security-csrf": "6.3.*", // v6.3.2
"symfony/twig-bundle": "6.3.*", // v6.3.0
"symfony/yaml": "6.3.*" // v6.3.3
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4", // 3.4.4
"phpunit/phpunit": "^9.5", // 9.6.13
"symfony/browser-kit": "6.3.*", // v6.3.2
"symfony/css-selector": "6.3.*", // v6.3.2
"symfony/debug-bundle": "6.3.*", // v6.3.2
"symfony/maker-bundle": "^1.48", // v1.51.1
"symfony/phpunit-bridge": "^6.2", // v6.3.2
"symfony/stopwatch": "6.3.*", // v6.3.0
"symfony/web-profiler-bundle": "6.3.*", // v6.3.2
"zenstruck/foundry": "^1.35", // v1.35.0
"zenstruck/mailer-test": "^1.3", // v1.3.0
"zenstruck/messenger-test": "^1.7" // v1.7.3
}
}
3 Comments
I am using MSSQL for my database, and when using the ResetDatabase trait I am unable to run my tests. They fail as foundy cannot drop the database because it is in use. The connection that is in use is the Test script that is running. Did i miss a step in the setup? or is this due to MSSQL?
Yo @jmwamser!
Hmm, I have no idea tbh. I've never used MSSQL, and I don't think the creator of Foundry has either, so it's quite possible that it's not coded correctly for that. You could try using https://github.com/dmaicher/doctrine-test-bundle instead to see if you have more luck.
Cheers!
Didn't have much luck there either. So i took a look at the old Testing Tutorial you guys had and was able to create a custom method to help me out. As well some of Foundries core methods.
I dug into the guts of DBAL to find this wonderful stuff as well.
"Houston: no signs of life"
Start the conversation!