Skip to content
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

@backupStaticProperties and @backupStaticAttributes trigger an error #5171

Closed
sebastianbergmann opened this issue Feb 5, 2023 · 0 comments
Closed
Assignees
Labels
feature/metadata/annotations feature/metadata/attributes feature/metadata Issues related to attributes and annotations type/bug Something is broken version/10 Something affects PHPUnit 10

Comments

@sebastianbergmann
Copy link
Owner

sebastianbergmann commented Feb 5, 2023

          After upgrading to 10.0.3, using either `@backupStaticProperties` or `@backupStaticAttributes` at the class level triggers this error:
An error occurred inside PHPUnit.

Message:  assert($metadata instanceof BackupStaticProperties)
Location: /var/www/html/framework/vendor/phpunit/phpunit/src/Framework/TestBuilder.php:189

#0 /var/www/html/framework/vendor/phpunit/phpunit/src/Framework/TestBuilder.php(189): assert(false, 'assert($metadat...')
#1 /var/www/html/framework/vendor/phpunit/phpunit/src/Framework/TestBuilder.php(63): PHPUnit\Framework\TestBuilder->backupSettings('ConfigTest', 'testCanSet')
#2 /var/www/html/framework/vendor/phpunit/phpunit/src/Framework/TestSuite.php(491): PHPUnit\Framework\TestBuilder->build(Object(ReflectionClass), 'testCanSet')
#3 /var/www/html/framework/vendor/phpunit/phpunit/src/Framework/TestSuite.php(132): PHPUnit\Framework\TestSuite->addTestMethod(Object(ReflectionClass), Object(ReflectionMethod))
#4 /var/www/html/framework/vendor/phpunit/phpunit/src/Framework/TestSuite.php(229): PHPUnit\Framework\TestSuite::fromClassReflector(Object(ReflectionClass))
#5 /var/www/html/framework/vendor/phpunit/phpunit/src/Framework/TestSuite.php(257): PHPUnit\Framework\TestSuite->addTestSuite(Object(ReflectionClass))
#6 /var/www/html/framework/vendor/phpunit/phpunit/src/Framework/TestSuite.php(275): PHPUnit\Framework\TestSuite->addTestFile('/var/www/html/f...')
#7 /var/www/html/framework/vendor/phpunit/phpunit/src/TextUI/Configuration/TestSuiteBuilder.php(76): PHPUnit\Framework\TestSuite->addTestFiles(Array)
#8 /var/www/html/framework/vendor/phpunit/phpunit/src/TextUI/Configuration/TestSuiteBuilder.php(46): PHPUnit\TextUI\Configuration\TestSuiteBuilder->testSuiteFromPath('/var/www/html/f...', Array)
#9 /var/www/html/framework/vendor/phpunit/phpunit/src/TextUI/Application.php(285): PHPUnit\TextUI\Configuration\TestSuiteBuilder->build(Object(PHPUnit\TextUI\Configuration\Configuration))
#10 /var/www/html/framework/vendor/phpunit/phpunit/src/TextUI/Application.php(97): PHPUnit\TextUI\Application->buildTestSuite(Object(PHPUnit\TextUI\Configuration\Configuration))
#11 /var/www/html/framework/vendor/phpunit/phpunit/phpunit(90): PHPUnit\TextUI\Application->run(Array)
#12 /var/www/html/framework/vendor/bin/phpunit(123): include('/var/www/html/f...')
#13 {main}

It works as expected when added at the method level.

Originally posted by @MichaelRushton in #4603 (comment)

@sebastianbergmann sebastianbergmann self-assigned this Feb 5, 2023
@sebastianbergmann sebastianbergmann added type/bug Something is broken feature/metadata Issues related to attributes and annotations feature/metadata/attributes feature/metadata/annotations version/10 Something affects PHPUnit 10 labels Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/metadata/annotations feature/metadata/attributes feature/metadata Issues related to attributes and annotations type/bug Something is broken version/10 Something affects PHPUnit 10
Projects
None yet
Development

No branches or pull requests

1 participant