I saw that at latest phpunit 6 is being used https://github.com/timber/timber/blob/11ef08aa9bde393bef6013bba224880a3d40533b/composer.json#L39
https://phpunit.de/supported-versions.html
https://www.php.net/supported-versions.php
Is this because timber/timberwants to support old php versions? Or can phpunit be upgraded to latest version ?
Good Q! Part of it is support for old versions of PHP (5.x, which still comprises 30% of WP usage). Part of it _might_ also be WordPress's testing framework itself, but I'm not sure. Try doing a PR and see if you're able to figure out how high we can support. I'd love to go up to PHPUnit v. 9 if possible!
Testing which phpunit version "might" run on older php versions is a bad idea. You need to follow the official recommended php versions for each phpunit version https://phpunit.de/supported-versions.html
So the question is which lower bound php version timber wants to support.
PHP 7.0 and up seem to capture 75% of the market https://wordpress.org/about/stats/ which is probably not good enough. On the other hand ... i really doubt that timber is used in wordpress setups that still use php 5.6. I think it's just best to follow PHP official security advisory and just drop support for old PHP versions.
Specific platforms can also be check by composer by the way https://getcomposer.org/doc/01-basic-usage.md#platform-packages
Looks like even though there's PHPUnit 8 + 9, WordPress only supports PHPUnit 7 which is now in the 2.x branch with #2244
WordPress only supports PHPUnit 7
Do you have a reference to this information?