Opened 10 years ago
Closed 9 years ago
#29020 closed task (blessed) (fixed)
Unit tests for dbDelta()
Reported by: | jdgrimes | Owned by: | jorbin |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Upgrade/Install | Keywords: | has-patch |
Focuses: | Cc: |
Description
Attachments (4)
Change History (19)
#1
@
10 years ago
- Keywords has-patch added
29020.diff is a first pass. Once applied, run
$ phpunit tests/phpunit/tests/admin/functions/dbdelta.php Installing... Running as single site... To run multisite, use -c tests/phpunit/multisite.xml Not running ajax tests... To execute these, use --group ajax. PHPUnit 3.7.28 by Sebastian Bergmann. Configuration read from /Users/johngrimes/svn/wordpress/trunk/phpunit.xml.dist ..S.... Time: 10.83 seconds, Memory: 24.50Mb OK, but incomplete or skipped tests! Tests: 7, Assertions: 10, Skipped: 1.
Skipped test is for backticks, related to #20263.
#2
follow-up:
↓ 3
@
10 years ago
Awesome, thanks! Let's toss the tests for #20263 into that ticket, rather than committing them now. (Now that we have a merged repo, they should be committed with the code to fix it.)
The best place for these tests is likely tests/phpunit/tests/db/dbDelta.php, class name Tests_DB_dbDelta. (Alternatively, tests/phpunit/tests/admin/includesUpgrade.php, class Tests_Admin_includesUpgrade.)
#3
in reply to:
↑ 2
@
10 years ago
Replying to nacin:
Awesome, thanks! Let's toss the tests for #20263 into that ticket, rather than committing them now. (Now that we have a merged repo, they should be committed with the code to fix it.)
The best place for these tests is likely tests/phpunit/tests/db/dbDelta.php, class name Tests_DB_dbDelta. (Alternatively, tests/phpunit/tests/admin/includesUpgrade.php, class Tests_Admin_includesUpgrade.)
29020.2.diff moves the tests to tests/phpunit/tests/db/dbDelta.php
, changes the class name, and removes the tests for #20263.
#5
@
10 years ago
- Milestone changed from Awaiting Review to 4.3
20920.2.diff looks like some good tests that are all currently passing.
I would like to see this combined with the tests added in [32108], likely by making those tests better (using the setup and teardown functions here for example ).
@pento - any thoughts on these tests?
#7
@
10 years ago
29020.2.diff is a good start.
I suspect dbDelta()
unit tests will be an ongoing effort, much like unit tests for wpautop()
. As we discover more edge cases, add more unit tests.
#8
@
10 years ago
Merges patch 29020.2.diff changes into existing tests file
Patch created at WordCamp Philly 2015
@tryon
@jtsternberg
@ebinnion
@JPry
@avnarun
@kevkoeh
@jorbin
@salcode
#10
@
9 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Added 'Insert Into' test for dbdelta
Patch created at WordCamp Philly 2015
#11
@
9 years ago
@jorbin, can you check on that additional patch and commit/close when you get a chance?
Initial tests