-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/test cleanup #271
Feature/test cleanup #271
Conversation
} | ||
|
||
$idpFiles = $this->getIdPMetadataFiles(); | ||
foreach ($idpFiles as $file) { | ||
$returnVal = include $file; | ||
$this->assertTrue(is_array($returnVal), 'Metadata file does not return array as expected. File: ' . $file); | ||
$this->assertIsArray($returnVal, 'Metadata file does not return array as expected. File: ' . $file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look at the assertions for PHPUnit, you'll notice they are static. Have the same clean up mess in MailAdmin to deal with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assertion methods are declared static and can be invoked from any context using PHPUnit\Framework\Assert::assertTrue(), for instance, or using $this->assertTrue() or self::assertTrue(), for instance, in a class that extends PHPUnit\Framework\TestCase. You can even use global function wrappers such as assertTrue().
https://docs.phpunit.de/en/11.2/assertions.html#static-vs-non-static-usage-of-assertion-methods
We use class AnnouncementTest extends TestCase
, so it is fine as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup of lazy assertTrue's and assertFalse's to more proper assertions. Though, explain that one change before merging, please.
Quality Gate passedIssues Measures |
Changed