Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,199 of 9,199 pages
About the help in other languages
All help pages

Testing

cd extension/exp_app_market && php ../../vendor/bin/phpunit -c phpunit.xml.dist

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/ext/exp_app_market/TESTING.md

On this page

Testing

Unit tests

cd extension/exp_app_market && php ../../vendor/bin/phpunit -c phpunit.xml.dist

No database and no network: money and the split, tax rules, pricing and promotions, upgrade policies, refund windows, paid sales off without the legal texts, the three providers against a recorded transport (requests, answers, Stripe's signature, PayPal's verification, the TRON amount, the chain check and the refund in the same coin, live mode refused on a test store), signed links, the remote issuer's signature, the seller score, partner benefits, payouts, the schema on every engine and the styling rules of templates and stylesheets.

End-to-end on a throwaway store

A test store in tmpfs (Exponential on SQLite with exp_package_registry and exp_app_market, [Market] TestMode=enabled), the providers pointed at tests/sandbox/provider-sandbox.php, a local simulator of the Stripe, PayPal and TronGrid APIs that plays the buyer on the hosted pages and sends signed webhooks. The flows run through the web pages with real sessions and form tokens:

  1. the app page (price, warranty, guarantees, quality, reviews apart) for anonymous visitors;
  2. a Stripe subscription purchase of EXP MCP: the sandbox page, the signed checkout.session.completed, the return page with the key once, the split, the kernel order, the license and its registry key, the invoice, the receipt;
  3. composer require of the private package: refused without a key, installed with the buyer's key;
  4. a renewal (invoice.paid): a new payment with its invoice; license and key move to the new period end;
  5. a PayPal purchase from a site's admin: the claim token back to the site, the key claimed once (410 after); a German buyer pays the seller's 19 % tax;
  6. a TRON purchase: the payment page, a TRC-20 transfer, the chain check;
  7. reviews: verified and community, moderation in the App Market tab, the seller's reply on the app page;
  8. a refund the seller approves (Stripe): license and key revoked, the key no longer installs;
  9. a crypto refund the seller does not answer: the daily run hands it to the store, the store approves, the operator's transfer back to the buyer's wallet is checked on the chain;
  10. a signed download link (a tampered one refused);
  11. the payouts of a closed month: commission, refunds, the 10 % holdback, paid through PayPal, the commission invoice.

Timed rules (the seller's 3 days, a closed month) are shown by moving the test rows' times, on the test store only. The scripts that build and drive the test store are kept outside this repository with the other operation scripts.

Payments in tests never use real keys or money: the sandbox accepts only sk_test_ keys, and a live provider is refused on a test store.

Something wrong on this page? Report an error

Documentation license

This page is part of the documentation of the extension exp_app_market and is distributed under the license of that extension.