Test suite: remove duplicate, fix namespaces/typos, add missing unit tests (#539)#551
Open
maltehuebner wants to merge 1 commit into
Open
Test suite: remove duplicate, fix namespaces/typos, add missing unit tests (#539)#551maltehuebner wants to merge 1 commit into
maltehuebner wants to merge 1 commit into
Conversation
Structural/quality fixes from the test-suite audit: - Remove the duplicated PollutantViewModelTest at the stale path tests/Pollutant/ViewModel/; keep the tests/Air/... copy (mirrors src/Air/) and port its unique testPollutionLevel case so no coverage is lost. - Fix the PSR-4 violation in tests/Controller/ControllerTest.php (declared namespace App\Tests\Controller\Api while living in tests/Controller/) -> App\Tests\Controller. - Remove the "$client = $client = ..." copy-paste typos in ControllerTest and ApiControllerTest. - Use assertSame for identity/value equality and assertEqualsWithDelta for the computed float in DistanceCalculatorTest. New unit tests for previously uncovered classes: - ValueDataConverter: pollutant-identifier mapping incl. case- insensitivity, underscore stripping (UV_INDEX_MAX) and unknown -> null. - UVIndexMax pollutant and UVIndexMaxLevel (the gap called out in the issue). Project Test Suite: 129 tests (was 121), all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the verifiable, unit-level items of #539.
Changes
Structure & quality
PollutantViewModelTestat the stale pathtests/Pollutant/ViewModel/(there is no matchingsrc/Pollutant/; thetests/Air/...copy mirrorssrc/Air/ViewModel/). Its one unique case,testPollutionLevel, was ported into the kept file so coverage is preserved.tests/Controller/ControllerTest.php(declarednamespace App\Tests\Controller\Api;while living intests/Controller/) →App\Tests\Controller.$client = $client = static::createClient();copy-paste typos (3× inControllerTest, 1× inApiControllerTest).assertSamefor identity/value equality, andassertEqualsWithDelta(..., 0.01)for the computed float inDistanceCalculatorTest(previously relied on the implementation'sround()).New unit tests (previously 0 coverage)
ValueDataConverterTest— the pollutant-identifier mapping edge cases from the issue: known identifier, case-insensitivity, underscore stripping (UV_INDEX_MAX→uvindexmax), and unknown →null(via reflection on theprotected static convertPollutant).UVIndexMaxTestandUVIndexMaxLevelTest— theUVIndexMax/UVIndexMaxLevelgap explicitly called out in the issue.Deliberately not implemented / deferred
vendor/lackssymfony/runtime, soWebTestCasecannot start), so this cannot be built or verified here.testImpressPagefrom the network (config/packages/impress.yamlusessource: remote_json). A test-env override is a config change that needs a kernel boot to verify; deferred with the CI-integration work.EntityMergertests. Its three confirmed bugs are tracked in [Hoch] Mass Assignment im EntityMerger + wirkungsloser #[Ignore]-Check #523 and being fixed separately; writing tests that assert the corrected behaviour here would either duplicate that work or turn the suite red against currentmain. Left to accompany the [Hoch] Mass Assignment im EntityMerger + wirkungsloser #[Ignore]-Check #523 fix.RequestConverter/deserializeRequestBodyToArray/StationCachetests. These need a geocoder mock/kernel/DB or touch code covered by the 500-route/[Hoch] Mass Assignment im EntityMerger + wirkungsloser #[Ignore]-Check #523 issues; deferred.Verification
vendor/bin/phpunit --testsuite="Project Test Suite"— OK (129 tests, was 121)vendor/bin/phpstan analyse --no-progress— No errorsRefs #539 (partial)
🤖 Generated with Claude Code