['type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'], 'name' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'], 'email' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'], 'phone' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'], 'password' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'], 'published' => ['type' => 'date', 'null' => true, 'default' => null, 'length' => null], 'created' => ['type' => 'date', 'null' => '1', 'default' => '', 'length' => ''], 'updated' => ['type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null], 'age' => ['type' => 'integer', 'null' => '', 'default' => '', 'length' => null], '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; /** * Initializes the schema * * @param array $config * @return void */ public function initialize(array $config) { $this->setSchema($this->_schema); } } /** * ValidateUser class */ class ValidateUsersTable extends Table { /** * schema method * * @var array */ protected $_schema = [ 'id' => ['type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'], 'name' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'], 'email' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'], 'balance' => ['type' => 'float', 'null' => false, 'length' => 5, 'precision' => 2], 'cost_decimal' => ['type' => 'decimal', 'null' => false, 'length' => 6, 'precision' => 3], 'null_decimal' => ['type' => 'decimal', 'null' => false, 'length' => null, 'precision' => null], 'ratio' => ['type' => 'decimal', 'null' => false, 'length' => 10, 'precision' => 6], 'population' => ['type' => 'decimal', 'null' => false, 'length' => 15, 'precision' => 0], 'created' => ['type' => 'date', 'null' => '1', 'default' => '', 'length' => ''], 'updated' => ['type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null], '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]; /** * Initializes the schema * * @param array $config * @return void */ public function initialize(array $config) { $this->setSchema($this->_schema); } } /** * FormHelperTest class * * @property \Cake\View\Helper\FormHelper $Form * @property \Cake\View\View $View */ class FormHelperTest extends TestCase { /** * Fixtures to be used * * @var array */ public $fixtures = ['core.Articles', 'core.Comments']; /** * Do not load the fixtures by default * * @var bool */ public $autoFixtures = false; /** * @var array */ protected $article = []; /** * setUp method * * @return void */ public function setUp() { parent::setUp(); Configure::write('Config.language', 'eng'); Configure::write('App.base', ''); static::setAppNamespace('Cake\Test\TestCase\View\Helper'); $request = new ServerRequest([ 'webroot' => '', 'base' => '', 'url' => '/articles/add', 'params' => [ 'controller' => 'articles', 'action' => 'add', ], ]); $this->View = new View($request); $this->Form = new FormHelper($this->View); $this->dateRegex = [ 'daysRegex' => 'preg:/(?: