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

Add unit tests for Core/Kpi #12232

merged 1 commit into from Jan 22, 2019


None yet
3 participants
Copy link

matks commented Jan 20, 2019

Questions Answers
Branch? develop
Description? Add unit tests for Core/Kpi classes
Type? improvement
Category? TE
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? Travis is green so 😄 tests are valid

This change is Reviewable

@matks matks force-pushed the matks:add-unit-tests-for-kpis branch from 16a185a to 7828211 Jan 21, 2019

$presenter = new KpiRowPresenter();
$this->assertInstanceOf(KpiRowPresenterInterface::class, $presenter);

This comment has been minimized.


Quetzacoalt91 Jan 22, 2019


Isn't it obvious with final class KpiRowPresenter implements KpiRowPresenterInterface and no constructor which may throw an exception?

This comment has been minimized.


matks Jan 22, 2019

Author Contributor

It's a non-regression tests that does not check the current implementation but rather attempts to make sure than any evolution of the KpiRowPresenter class will keep implementing KpiRowPresenterInterface.

In some projets, I have seen 1 interface being implemented by 3 classes. Over time, the interface evolved, 2 of the classes were updated accordingly but the last class was left unmodified and this introduced bugs months later. This test attempts to prevent that.

@Quetzacoalt91 Quetzacoalt91 added this to the milestone Jan 22, 2019

@Quetzacoalt91 Quetzacoalt91 merged commit 726f3a5 into PrestaShop:develop Jan 22, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment