Closed (fixed)
Project:
Address
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Reporter:
Created:
10 Oct 2015 at 23:02 UTC
Updated:
15 Jun 2016 at 01:04 UTC
Jump to comment: Most recent, Most recent file
We should create a simpletest that tests the zone form, confirming that it's possible to add a zone, and add/remove zone members (via ajax).
The resulting entity should be compared with expected values, and the $zone->match() method used to ensure it works.
We can create a zone that has an EU zone member and a California zone member to test the EU and Country zone members at least.
Then create another zone that references that one (zone_member_zone) to check that as well.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | zone_test-2587013-7.patch | 9.38 KB | vasike |
Comments
Comment #2
michfuer commentedComment #3
vasikethere is a first patch for this.
It doesn't include the member zone and its ajax stuff.
So more work needed on this
However working on this i noticed there is an warning on submit zone without zone members:
Warning: Invalid argument supplied for foreach() in Drupal\address\Form\ZoneForm->submitForm() (line 246 of /d8_path/modules/address/src/Form/ZoneForm.php).The patch include a fix for this.
Comment #4
vasikeforgot the patch
Comment #5
vasikeand here is a more complete patch
- Merge all the Zone entity (CRUD) operations to one test method
so now we have:
- Create zone from UI
- Edit the new zone from UI: change the name and add 2 members EU and California.
- Delete zone from UI.
that would be all.
Comment #6
vasikesmall update: Convert camelCase to snake_case for a variable.
Comment #7
vasikeUpdate the patch:
- Separate the tests for create/edit/delete
- Add extra checks for the form elements existence.
Comment #9
bojanz commentedExpanded, committed.