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

fix testRemoveIrrelevantPostmeta #1608

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

nelarsen
Copy link
Contributor

@nelarsen nelarsen commented Jul 1, 2024

Mit Bezug auf #1605 ist das Ziel dieser PR die u.g. Fehlermeldungen (WP latest PHP 8.2) loszuwerden. Die Warnungen wurden vom Test testRemoveIrrelevantPostmeta() ausgelöst, weil update_post_meta() fehlerhaft mit einem Objekt statt mit einer Post-ID aufgerufen wurde. Anmerkung: Der Test kann vorher nicht funktioniert haben, nach der PR ist er weiterhin erfolgreich.

PHP Deprecated: Creation of dynamic property CommonsBooking\Model\Timeframe::$ID is deprecated in /tmp/wordpress/wp-includes/post.php on line 2808
PHP Deprecated: Creation of dynamic property CommonsBooking\Model\Timeframe::$filter is deprecated in /tmp/wordpress/wp-includes/post.php on line 2813

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.78%. Comparing base (076ae51) to head (2451e83).
Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1608      +/-   ##
============================================
- Coverage     49.79%   49.78%   -0.01%     
  Complexity     2682     2682              
============================================
  Files            97       97              
  Lines         10712    10712              
============================================
- Hits           5334     5333       -1     
- Misses         5378     5379       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hansmorb
Copy link
Contributor

hansmorb commented Jul 3, 2024

Wahrscheinlich hat der Test nicht funktioniert, weil das PostMeta vorher nie beschrieben wurde, oder? Dadurch, dass es leer geblieben ist hatte die Funktion auch nichts zu entfernen. Könntest du mal testen, ob der Test jetzt fehlschlägt wenn du den Funktionsaufruf auskommentiertst?

@nelarsen
Copy link
Contributor Author

nelarsen commented Jul 3, 2024

Wahrscheinlich hat der Test nicht funktioniert, weil das PostMeta vorher nie beschrieben wurde, oder? Dadurch, dass es leer geblieben ist hatte die Funktion auch nichts zu entfernen. Könntest du mal testen, ob der Test jetzt fehlschlägt wenn du den Funktionsaufruf auskommentiertst?

Du hast Recht. Ich hatte das nicht getestet, aber jetzt eben gemacht (Timeframe::removeIrrelevantPostmeta( $tf ) auskommentiert), dann kommt wie erwartet:

  1. CommonsBooking\Tests\Wordpress\CustomPostType\TimeframeTest::testRemoveIrrelevantPostmeta
    Failed asserting that an array is empty.
    (Siehe: https://github.com/nelarsen/commonsbooking/actions/runs/9775755786/job/26986841945 )

Lässt du die Tests auch lokal laufen? Ich weiß nicht, wie man es einrichtet. Ich habe immer nur auf Github gepushed, was echt mühsam ist.

@hansmorb
Copy link
Contributor

hansmorb commented Jul 3, 2024

Schau mal in der README unter "Test Plugin". Danke fürs Testen, dann passt das so.

@hansmorb hansmorb merged commit e109db5 into wielebenwir:master Jul 3, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants