testIsValidMXRecord() does a real live DNS lookup via
isValidMXRecord(), which is inherently CI-environment dependent. In a
recent Travis run, the assertion for usace.army.mil (result expected
1) failed while the other three domains in the same test resolved
correctly, indicating the .mil zone specifically was filtered/
unreachable from that CI network rather than any bug in
isValidMXRecord() itself - .mil DNS is a known target for network
filtering on shared CI infrastructure.
Replace it with microsoft.com, which has the same "domain with a
valid MX record" semantics but a far more globally reachable, stable
DNS setup less likely to be blocked by CI network policies.
The substr offsets in dol_print_phone did not line up with the segment
lengths, so formatted numbers repeated one digit and lost another.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
get_default_tva() VATRULE 2 selects the VAT rate attached to the buyer
department (c_tva.fk_department_buyer) but filters only on the department id.
Unlike get_product_vat_for_country(), it omits t.active and t.entity, so a
disabled rate (or a rate from another entity) can be returned as the default,
and because of the taux DESC ordering an inactive higher rate wins over the
active one.
Add "AND t.active > 0" and "AND t.entity IN (getEntity('c_tva'))" to the query.
The ordering is unchanged, so the documented behaviour is preserved: the rate
flagged Default (use_default) wins, otherwise the highest active rate.
Add testGetDefaultTvaForBuyerState() covering VATRULE 2, which was previously
untested: it asserts the active department rate is selected and the inactive
one is ignored.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* Qual: Add testcase for price2num to convert '21.500,00' in FR
* NEW: Accept numbers like 1.213,00 in locales with whitespace/empty thousands separator
# NEW: Accept numbers like 1.213,00 in locales with whitespace/empty thousands separator
- Graceful handling of comma and dot as decimal points and thousands separators in the `price2num` function.
- Improved the `getNonEmptyString` function to include proper indentation and spacing (automatic).
* Add testcases for price2num
* en_US tests for invalid prices, add doc for price2num regex
* Restore lost test to validate compatibility
* Update FunctionsLibTest.php
---------
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
# Fix: Correctly close active output buffer.
Use ob_get_clean(), not ob_get_contents() and ob_clean().
Tests were failing with:
FunctionsLibTest::testVerifCond with data set "Test that verifConf("0") returns false" ('0', false)
Test code or tested code did not (only) close its own output buffers
OK, but incomplete, skipped, or risky tests\!
Also refactored a test case to use a data provider which helped identify that it was related
to dol_eval.