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

BookingTest_AJAX_Test: proper cleanup of created database table #1610

Merged

Conversation

nelarsen
Copy link
Contributor

@nelarsen nelarsen commented Jul 1, 2024

Mit Bezug auf #1605 ist das Ziel dieser PR, die u.g. Warnung loszuwerden. Sie kam zu stande, weil die Tests in BookingTest_AJAX_Test die DB-Tabelle wptests_cb_bookingcodes erstellen, aber nicht wieder löschen. Die Lösung ist, die Tabelle in tearDown() ordentlich zu löschen.

WordPress database error Table 'wptests_cb_bookingcodes' already exists for query CREATE TABLE wptests_cb_bookingcodes (
date date DEFAULT '0000-00-00' NOT NULL,
timeframe bigint(20) unsigned NOT NULL,
location bigint(20) unsigned NOT NULL,
item bigint(20) unsigned NOT NULL,
code varchar(100) NOT NULL,
PRIMARY KEY (date, timeframe, location, item, code)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci; made by PHPUnit\TextUI\Command::main, PHPUnit\TextUI\Command->run, PHPUnit\TextUI\TestRunner->run, PHPUnit\Framework\TestSuite->run, PHPUnit\Framework\TestSuite->run, PHPUnit\Framework\TestSuite->run, PHPUnit\Framework\TestCase->run, PHPUnit\Framework\TestResult->run, PHPUnit\Framework\TestCase->runBare, CommonsBooking\Tests\View\CalendarTest->setUp, CommonsBooking\Tests\Wordpress\CustomPostTypeTest->setUp, CommonsBooking\Tests\Wordpress\CustomPostTypeTest->setUpBookingCodesTable

the created database table for bookingcodes was not deleted after test, potentially affecting other tests and causing warnings
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.79%. Comparing base (076ae51) to head (a5bc339).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1610   +/-   ##
=========================================
  Coverage     49.79%   49.79%           
  Complexity     2682     2682           
=========================================
  Files            97       97           
  Lines         10712    10712           
=========================================
  Hits           5334     5334           
  Misses         5378     5378           

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

@hansmorb hansmorb added php Pull requests that update Php code dx Developer Experience (technical) labels Jul 2, 2024
@hansmorb hansmorb merged commit 12cecef into wielebenwir:master Jul 2, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx Developer Experience (technical) php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants