Testing
Unit tests
cd extension/exp_app_market && php ../../vendor/bin/phpunit -c phpunit.xml.distNo 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:
- the app page (price, warranty, guarantees, quality, reviews apart) for anonymous visitors;
- 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; composer requireof the private package: refused without a key, installed with the buyer's key;- a renewal (
invoice.paid): a new payment with its invoice; license and key move to the new period end; - 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;
- a TRON purchase: the payment page, a TRC-20 transfer, the chain check;
- reviews: verified and community, moderation in the App Market tab, the seller's reply on the app page;
- a refund the seller approves (Stripe): license and key revoked, the key no longer installs;
- 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;
- a signed download link (a tampered one refused);
- 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.