TripalCultivate / TripalCultivate-Phenotypes

Provides generic support for large scale phenotypic data and traits with importers, content pages and visualizations.
GNU General Public License v3.0
1 stars 0 forks source link

G5.120 Test for Validator Trait ColumnCount is missing checks for exception status #120

Open carolyncaron opened 2 weeks ago

carolyncaron commented 2 weeks ago

Branch

g5.120-addColumnCountAsserts

Groups

Group 5 | Automated Testing | Performance

Describe

In PR #119, I was notified by PHP Sniffer that ValidatorTraitColumnCountTest.php has unused variable $exception_caught on lines 151, 158, 169, and 177. See code block below: https://github.com/TripalCultivate/TripalCultivate-Phenotypes/blob/17ba2dea7b554b588a556c09756a83ecdc2f439c/trpcultivate_phenotypes/tests/src/Kernel/Validators/Traits/ValidatorTraitColumnCountTest.php#L151-L177

Design

Instead of removing the variables, there should be asserts added to check for it. This involves adding expected outcomes to the data provider provideExpectedColumnsForSetter().