Create golden master tests for SpendenDumper
Closed, ResolvedPublic5 Story Points

Description

As a developer,
I want to be able to refactor SpendenDumper with confidence,
so that I can add new features and perform changes.

Acceptance Criteria:

  • Golden master input and output data are check in the backend repository. this data must be anonymous but as close to the real data as possible.
  • Automated test comparing SpendenDumper output for given input data with the checked-in golden master output.

Background:
Consider writing a "scramble" script that can anonymize real data by changing it without changing format and type.
Alternatively, write a class that can create instances of all possible donation data permutations:

  • Amounts
  • Intervals (0,1,3,6,12)
  • Address data
    • Company, Private and Anonymous
    • Umlauts, long names, etc
    • Swiss, Austrian, Italian, Netherlands and Luxemburg Addresses
  • Payment types:
    • Paypal data:
      • confirmed and unconfirmed
      • for existing donation and "spontaneous"
      • recurring and one-off
    • MCP data
      • confirmed and unconfirmed
    • Bank transfer data (with bank transfer code)
    • Direct debit: IBAN and BIC from Germany and other countries
    • Sofort (with bank tranfer code, with and without confirmation date)
  • Statuses (must match payment type)
  • tracking data
  • public/private
  • newsletter opt-in
  • With and without comments
  • Exported and deleted time stamps
gabriel-wmde updated the task description. (Show Details)Jul 20 2017, 2:18 PM

Might be a good case for using Eris (example: https://github.com/wmde/Euro/pull/3)

    Amounts
	pos float
    Intervals (0,1,3,6,12)
	pos int
    Address data
        Company, Private and Anonymous
		data[vorname] or data[nachname] or data[firma]
        Umlauts, long names, etc
		data[vorname, nachname, strasse, ort]
        Swiss, Austrian, Italian, Netherlands and Luxemburg Addresses
		data[country(code iso2)], data[plz(A-Z0-9\s-)]
    Payment types:
        Paypal data:
            confirmed and unconfirmed
		data[paypal_*], data[ext_payment_*] IF status='E' OR null
        MCP data
            confirmed and unconfirmed
		data[mcp_*], data[ext_payment_*] IF status='E' OR null
        Bank transfer data (with bank transfer code)
		donation->setBankTransferCode(A-Z0-9_-)
        Direct debit: IBAN and BIC from Germany and other countries
		data[iban, bic, konto, blz, bankname]
			'iban' A-Z0-9
			'bic' A-Z0-9
			'konto' 0-9
			'blz' => 0-9
			'bankname' A-Z0-9
        Sofort (with bank tranfer code, with and without confirmation date)
		donation->setBankTransferCode(A-Z0-9_-)
    Statuses
	DONATION::STATUS_*
    tracking data
	'layout' => \w
	'impCount' pos int
	'bImpCount' pos int
	'tracking' => \w
	'skin' => \w
	'color' => \w
	'source' => \w
    public/private
	donation->setIsPublic (mysql: is_public)
		bool
    newsletter opt-in
	donation->setDonorOptsIntoNewsletter (mysql: info)
		bool
    With and without comments
	donation->setComment
		mind newline, tabs, umlauts
    Exported and deleted time stamps
	dt_del, dt_new, dt_exp, dt_gruen
Pablo-WMDE added a comment.EditedAug 1 2017, 11:48 AM

WIP https://github.com/wmde/fundraising-backend/tree/dumper-testing

added test

  • donations
  • membership applications
  • subscriptions
JeroenDeDauw closed this task as Resolved.Sep 17 2017, 4:22 PM