Add SessionHijackingMitigationMiddleware to README.md
Prefer literal-string
over non-empty-string
Remove randomness from test case
how to output/unmute phpunit output while using paratest
You can't, sorry
It is likely you have a race condition that only occurs within the concurrency operations of parallel tests running.
Which means that multiple tests use the same I/O device (i.e. a simple file on the filesystem) and they step on each other.
Avoid this by using unique file names for each TestCase, for example:
protected function setUp(): void
{
$this->file = __DIR__ . '/test_file_' . sha1(uniqid(__METHOD__));
}
| Q | A | --- | --- | ParaTest version | 7.1.2 | PHPUnit version |10.0.18 | PHP version | 8.2.4
I run an XML configuration file using Paratest via PHPStorm and it fails even before the test really begins.
As I said in the title, I use the PHAR version of PHPUnit 10.0.18 and I have installed Paratest 7.1.2 globally via Composer. I am launching it via PHPStorm 2022.3.3.
I use an XML configuration file and a custom bootstrap that contains a custom autoloader for my own framework.
I get :
/usr/bin/php /home/lionel/.config/composer/vendor/bin/paratest_for_phpstorm /var/www/html/lib/phpunit.phar --bootstrap /var/www/html/perso/otra/tests/testBootstrap.php -v --configuration /var/www/html/perso/otra/tests/phpunitAll.xml --teamcity Testing started at 10:40 ... PHP Fatal error: Uncaught RuntimeException: Missing path to '/phpunit' in /home/lionel/.config/composer/vendor/brianium/paratest/src/Util/PhpstormHelper.php:60 Stack trace: #0 /home/lionel/.config/composer/vendor/brianium/paratest/src/Util/PhpstormHelper.php(20): ParaTest\Util\PhpstormHelper::getArgvKeyFor() #1 /home/lionel/.config/composer/vendor/brianium/paratest/bin/paratest_for_phpstorm(10): ParaTest\Util\PhpstormHelper::handleArgvFromPhpstorm() #2 /home/lionel/.config/composer/vendor/bin/paratest_for_phpstorm(120): include('...') #3 {main} thrown in /home/lionel/.config/composer/vendor/brianium/paratest/src/Util/PhpstormHelper.php on line 60
Process finished with exit code 255
I tried (temporarily, just to see if it works) to replace in the file ~/.config/composer/vendor/brianium/paratest/src/Util/PhpstormHelper.php
the line :
$phpunitKey = self::getArgvKeyFor($argv, '/phpunit');
by
$phpunitKey = self::getArgvKeyFor($argv, '/var/www/html/lib/phpunit.phar');
but then I got :
/usr/bin/php /home/lionel/.config/composer/vendor/bin/paratest_for_phpstorm /var/www/html/lib/phpunit.phar --bootstrap /var/www/html/perso/otra/tests/testBootstrap.php -v --configuration /var/www/html/perso/otra/tests/phpunitAll.xml --teamcity Testing started at 10:41 ... ParaTest v7.1.2 upon PHPUnit 10.0.18 by Sebastian Bergmann and contributors.
Path not found for the class name : phpunit\framework\TestCase PHP Fatal error: Uncaught Error: Class "phpunit\framework\TestCase" not found in /var/www/html/perso/otra/tests/src/BlocksTest.php:13 Stack trace: #0 /home/lionel/.config/composer/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php(107): require_once() #1 /home/lionel/.config/composer/vendor/phpunit/phpunit/src/Runner/TestSuiteLoader.php(46): PHPUnit\Runner\TestSuiteLoader->loadSuiteClassFile() #2 /home/lionel/.config/composer/vendor/phpunit/phpunit/src/Framework/TestSuite.php(257): PHPUnit\Runner\TestSuiteLoader->load() #3 /home/lionel/.config/composer/vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/TestSuiteMapper.php(92): PHPUnit\Framework\TestSuite->addTestFile() #4 /home/lionel/.config/composer/vendor/phpunit/phpunit/src/TextUI/Configuration/TestSuiteBuilder.php(53): PHPUnit\TextUI\XmlConfiguration\TestSuiteMapper->map() #5 /home/lionel/.config/composer/vendor/brianium/paratest/src/WrapperRunner/SuiteLoader.php(52): PHPUnit\TextUI\Configuration\TestSuiteBuilder->build() #6 /home/lionel/.config/composer/vendor/brianium/paratest/src/WrapperRunner/WrapperRunner.php(103): ParaTest\WrapperRunner\SuiteLoader->__construct() #7 /home/lionel/.config/composer/vendor/brianium/paratest/src/ParaTestCommand.php(89): ParaTest\WrapperRunner\WrapperRunner->run() #8 /home/lionel/.config/composer/vendor/symfony/console/Command/Command.php(312): ParaTest\ParaTestCommand->execute() #9 /home/lionel/.config/composer/vendor/symfony/console/Application.php(1022): Symfony\Component\Console\Command\Command->run() #10 /home/lionel/.config/composer/vendor/symfony/console/Application.php(314): Symfony\Component\Console\Application->doRunCommand() #11 /home/lionel/.config/composer/vendor/symfony/console/Application.php(168): Symfony\Component\Console\Application->doRun() #12 /home/lionel/.config/composer/vendor/brianium/paratest/bin/paratest(37): Symfony\Component\Console\Application->run() #13 /home/lionel/.config/composer/vendor/brianium/paratest/bin/paratest_for_phpstorm(10): require('...') #14 /home/lionel/.config/composer/vendor/bin/paratest_for_phpstorm(120): include('...') #15 {main} thrown in /var/www/html/perso/otra/tests/src/BlocksTest.php on line 13
Process finished with exit code 255
Error that I didn't get without the use of Paratest.
Hi, we only support PHPUnit installed by composer, sorry
Bumps actions/stale from 7 to 8.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)github-actions(deps): bump actions/stale from 7 to 8 (#746)
Bumps actions/stale from 7 to 8.
updated-dependencies:
Signed-off-by: dependabot[bot] support@github.com Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Could you write a small, self-contained reproducible environment where this bug happens please?
This issue has been moved from the zendframework
repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html
Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/7156 User: @epoleacov Created On: 2015-01-25T22:22:49Z Updated At: 2015-10-19T21:10:08Z Body When nested object bonded to form with related collection elements, this collection elements has just empty objects. So for example if we run next test:
ZendTest\Form\Element\CollectionTest::testCanBindObjectMultipleNestedFieldsets()
final object used for assertion should have original data ($_product->getObject()->getPrice() == 200), but it has just NULL instead.
Main cause of that is because when values extracted from collection is just takes extracted values, but forget about objects what was used in extraction which should be saved inside of collection under "object" property, which on his side used later for filling collection target elements on populateValues();
Next is line where values extracted, but objects are lost: https://github.com/zendframework/zf2/blob/b1e9f3bb3ce9cdc925139d98672af40f6b0f33d7/library/Zend/Form/Element/Collection.php#L528
User: @iprdp Created On: 2015-04-20T18:15:00Z Updated At: 2015-04-20T18:15:00Z Body I have worked around this bug by creating the targetElementInstance during extract(). Not sure if this is good enough for a fix.
User: @adamlundrigan Created On: 2015-10-19T21:10:08Z Updated At: 2015-10-19T21:10:08Z Body @epoleacov could you provide an example showing the behaviour you are seeing? I'm not having any luck reproducing what you're trying to explain
Originally posted by @GeeH at https://github.com/zendframework/zend-form/issues/95
Update to include target type in collection element spec built from annotation to later be used to create new element
Signed-off-by: Raul Robledo riul88@gmail.com
Fix assertion to use correct type
Signed-off-by: Raul Robledo riul88@gmail.com
Fix php8.1 validations
Signed-off-by: Raul Robledo riul88@gmail.com
Code refactoring, fix var data type annotation and added missing psalm DocblockTypeContradiction
Signed-off-by: Raul Robledo riul88@gmail.com
Merge pull request #212 from riul88/hotfix/33
Fixes #33 Collection has empty bonded nested objects
Merge pull request #213 from laminas/3.10.x-merge-up-into-3.11.x_1IuVaE4L
Merge release 3.10.1 into 3.11.x
3.10.x bugfix release (patch)
Update to include target type in collection element spec built from annotation to later be used to create new element
Signed-off-by: Raul Robledo riul88@gmail.com
Fix assertion to use correct type
Signed-off-by: Raul Robledo riul88@gmail.com
Fix php8.1 validations
Signed-off-by: Raul Robledo riul88@gmail.com
Code refactoring, fix var data type annotation and added missing psalm DocblockTypeContradiction
Signed-off-by: Raul Robledo riul88@gmail.com
Merge pull request #212 from riul88/hotfix/33
Fixes #33 Collection has empty bonded nested objects
Update to include target type in collection element spec built from annotation to later be used to create new element
| Q | A |-------------- | ------ | Documentation | no | Bugfix | yes | BC Break | yes/no | New Feature | no | RFC | yes/no | QA | yes
As described in issue #33 , collection has empty bounded nested objects, while iterating thru the data the method createNewTargetElementInstance is called to retrieve a new instance of the element, but as the Object is null when trying to hydrate the element the result is an array of nulls in the collection
Added test case testAllowsComposingMultipleChildEntitiesWithEntityBind to validate the result object after binding, with current functionality the assertions to ensure the elements are instances of EntityObjectPropertyHydrator fail as the values of the elements is null