assertTrue($this->validate(self::RULE, $input)); } public function successProvider() { return [ ['{}'], ['{"testing": true}'], ]; } /** * @dataProvider errorProvider */ public function testError($input) { $this->assertNotTrue($this->validate(self::RULE, $input)); } public function errorProvider() { return [ ['{}}'], ['{test:true}'], ['{"test":text}'], ]; } public function testWhenInputIsEmptyAndNotRequiredIsSuccess() { $this->assertTrue($this->validate(self::RULE, '')); } }