Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294882

ResourceTestBase should use assertEquals over assertSame when comparing data

$
0
0

Problem/Motivation

ResourceTestBase uses assertSame for asserting values. This is breaks comparisons of stringified floats, making the test class hard to use.

assertEquals also returns a generated difference between the values, which assertSame does not. This would improve the DX for comparing JSON:API documents.

See #3128322: Filtering variations over JSON:API is always access false.

Steps to reproduce

Use a decimal field with precision storage of 6. 4.00 will serialize to JSON as 4.0 but return from MySQL as 4.00000

Proposed resolution

Switch from assertSame to assertEquals

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 294882

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>