Closed (fixed)
Project:
Charts
Version:
5.0.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
29 Sep 2023 at 21:05 UTC
Updated:
20 Dec 2023 at 04:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
andileco commentedComment #4
andileco commentedFixes two minor coding standards issues.
Comment #5
nikathoneDid a quick review of the code and some initial manual test. I think we need to create a follow up issue for adding test coverage or commit the current patch, then change its status to needs work and tag it with need tests.
Comment #6
andileco commentedThank you, @nikathone! Let's commit this and then add tags for tests.
Comment #8
andileco commentedAdding the needs tests tag.
Comment #9
diaodiallo commentedAdded test coverage as suggested.
Comment #10
diaodiallo commentedFixed two coding standard issues.
Comment #11
nikathoneMaybe we should throw a logic exception here instead of the plugin not found one. This could be something like
throw new \LogicException(sprintf('The provided chart type "%s" is not supported by "%s" chart plugin library.', $type_name, $plugin->getChartName()));.If you agree with the above then we should also update the test to catch the logic exception.
I don't think we need to assert that the element is not empty since our primary goal is to check for the exception. However we need to change the expected exception to
$this->expectException(\LogicException::class);and also maybe check for the expected message to see if it includes our "not_supported" type and the "charts_test_library" something like$this->expectExceptionMessage('The provided chart type "not_supported" is not supported by "Charts Test Library" chart plugin library.');should do.This part is already covered by https://git.drupalcode.org/project/charts/-/blob/5.0.x/tests/src/Kernel/.... If for example in that test they were using a not supported type the test would fail.
Comment #14
andileco commentedThis works really well - thank you!