\JSONTextTest
Synopsis
class JSONTextTest
extends SapphireTest
{
- // members
- protected array $fixtures = ;
- // methods
- public void __construct()
- public void testIsValidExpression()
- public void testIsValidJson()
- public void testIsValidDBValue()
- public void testToSSTypes()
- private string getFixture()
Hierarchy
Extends
- SilverStripe\Dev\SapphireTest
Tasks
Line | Task |
---|---|
44+ | There are a ton more permutations of a JSONPath regex See the trace() method in JSONPath for more examples to work from |
Members
protected
- $fixtures — array
Methods
private
- getFixture() — Get the contents of a fixture
public
- __construct() — JSONTextTest constructor.
- testIsValidDBValue() — Ordinarily we can just use !is_null(json_decode($json)) but SS allows empty strings passed to setValue() so we need to allow otherwise invalid JSON by means of an optional 2nd param
- testIsValidExpression()
- testIsValidJson()
- testToSSTypes() — Properly excercise our internal SS type conversion.