Skip to content
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

allow restrictions to be retrieved only by item / location #1179

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

hansmorb
Copy link
Contributor

@hansmorb hansmorb commented Feb 28, 2023

closes #1178
UnitTests schon vorgebaut in experiment/unittests UnitTests sind mit dabei

@datengraben
Copy link
Contributor

Ich verstehe nicht wieso du die Tests in einem separaten Branch eincheckst. Ausgeführt werden sie hier in diesem Branch doch auch. Welchen Grund hat das?

@hansmorb
Copy link
Contributor Author

hansmorb commented Mar 1, 2023

Ich verstehe nicht wieso du die Tests in einem separaten Branch eincheckst. Ausgeführt werden sie hier in diesem Branch doch auch. Welchen Grund hat das?

Das stimmt, der Fehler ist aufgeflogen als ich neue Unit Tests auf dem anderen Branch gebastelt habe. Aber habe sie auch mal hier eingefügt.

@hansmorb hansmorb added the bug Something isn't working label Mar 16, 2023
# Conflicts:
#	tests/Model/ItemTest.php
#	tests/Model/LocationTest.php
@hansmorb hansmorb requested review from datengraben and removed request for datengraben June 2, 2023 19:27
@hansmorb
Copy link
Contributor Author

hansmorb commented Jun 2, 2023

Das ist potentiell ein heikler Change, weil die filterPosts sehr oft von vielen Methoden verwendet wird.

@datengraben
Copy link
Contributor

@hansmorb Stimmt, grundsätzlich würde ich sagen sollten wir einfach versuchen via Unit-Tests für Repository/Restriction alles abzufrühstücken.
Also noch folgende Fälle:

  • Query nur mit einer Location-ID
  • Query nur mit einer Item-ID
  • Und vielleicht noch einen Fall mit einem Array mit mehreren Elementen.

Zusätzlich habe ich mal eine Liste aller Aufrufer gemacht. Ggf. können wir die Testfälle für diese Methoden auf Vollständigkeit überprüfen. Oder um uns noch sicherer zu fühlen schreiben wir ein paar E2E Tests.

Liste der Callee's (via PHPStorm)

  • src/Helper/Wordpress.php
    • getRelatedPostsIdsForItem
    • getRelatedPostsIdsForLocation
  • src/Model/Day.php
    • getRestrictions
  • src/Model/Item.php
    • getRestrictions
  • src/Model/Location.php
    • getRestrictions
  • src/View/Item.php
    • getTemplateData
  • src/View/Location.php
    • getTemplateData

@codecov
Copy link

codecov bot commented Sep 26, 2023

Codecov Report

Merging #1179 (3d46b78) into master (8abd9e2) will increase coverage by 0.20%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #1179      +/-   ##
============================================
+ Coverage     35.85%   36.06%   +0.20%     
- Complexity     2115     2117       +2     
============================================
  Files            83       83              
  Lines          8596     8602       +6     
============================================
+ Hits           3082     3102      +20     
+ Misses         5514     5500      -14     
Files Coverage Δ
src/Repository/Restriction.php 87.61% <100.00%> (+0.75%) ⬆️

... and 2 files with indirect coverage changes

@hansmorb hansmorb marked this pull request as draft October 22, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

filterPosts bei Restrictions filtert zu viel
2 participants