public function _checkFieldName() { $errors = []; if (!StringHelper::isValidVariableName($this->name)) { $errors = [CheckError::createObject(['message' => sprintf(' "%s" is not a valid field name on model %s .', $this->name, $this->scopeModel->getFullClassName()), 'hint' => null, 'context' => $this, 'id' => 'fields.E001'])]; } return $errors; }
/** * @dataProvider providerValidVariableName * * @param $originalString * @param $expectedString * * @since 1.1.0 * * @author Eddilbert Macharia (http://eddmash.com) <*****@*****.**> */ public function testIsValidVariableName($originalString) { $this->assertTrue(StringHelper::isValidVariableName($originalString)); }