public function testDecodeJson() { $model = new TestModel(); $model->jsonProperty = 'foo'; $model->foo = '{"bar":"baz"}'; $this->assertEquals(json_decode('{"bar":"baz"}'), $model->foo()->all()); return $model; }
public function testArrayMethodCall() { $model = new TestModel(); $model->jsonProperty = ['foo', 'bar']; $model->foo = null; $model->bar = null; $this->assertInstanceOf(JsonProperty::class, $model->foo()); $this->assertInstanceOf(JsonProperty::class, $model->bar()); }