G4 Link states
Every state of the confirmation link page: random, malformed and expired tokens (invalid), used token, signed in as a different account (with recovery), changed account email, and nothing left to add. Expired, used, wrong-customer, email-changed and nothing-left are reached by inserting or editing DB rows.
A15 Random 64-hex token
logged-out visitor opens a random 64-hex token: data-state=invalid, text "This link is invalid or has expired...", clean URL order_link/confirm without token; the "My Account" link in the text leads to the login page (token generated in the script, no DB rows)
A16 Malformed token `abc`
logged-out visitor opens token "abc" (not 64 hex): same invalid text and clean URL as A15
A17 Expired token
expired state reached by DB manipulation (link row inserted with date_expires 60 s in the past): invalid text, clean URL; the guest order stays unlinked (customer_id 0), link not marked used
A18 Used token
used state reached by DB manipulation (link row inserted with date_used set): data-state=used, text "This link has already been used...", clean URL; nothing linked. The genuine used-after-confirm case is in G1/A01
A19 Signed in as a different account, then recovery
signed in as B opens A's link (link row inserted via DB): wrong_customer text; then logout, login as A, open the confirm route (token kept in session), password, success "Orders added to your account: 1"
A20 Account email changed after the link was sent
email change reached by DB manipulation (UPDATE oc_customer email after the link row was inserted); logged in with the new address: email_changed text; order stays unlinked, link unused
A21 Nothing left to add
reached by DB manipulation (fake order's customer_id set to the customer after the link row was inserted): password step, then data-state=none "Your email address is confirmed. There was nothing left to add..."










