Пример #1
0
 protected function setUp()
 {
     $this->forms = $forms = \Webchemistry\Test\Services::forms(TRUE);
     $forms->addForm('form', function () {
         $form = new \Form();
         $form->addDate('date', '', 'j.m.Y H:i')->setType(\WebChemistry\Forms\Controls\Date::TIMESTAMP);
         return $form;
     });
     $forms->addForm('defaultDate', function () {
         $form = new \Form();
         $form->addDate('date');
         return $form;
     });
 }
Пример #2
0
 public function testS()
 {
     $forms = Services::forms();
     $forms->addForm('my', function () {
         $form = new \Form();
         $form->addMask('mask')->setMask('999 aaa');
         $form->addMask('regex')->setRegex('[0-9]{3} [a-z]{3}');
         return $form;
     });
     $response = $forms->createRequest('my', ['mask' => 'xsda']);
     $form = $response->getForm();
     $this->assertTrue($form->isSubmitted());
     $this->assertSame('xsda', $form['mask']->getValue());
 }
Пример #3
0
 protected function setUp()
 {
     $this->forms = $forms = Services::forms(TRUE);
     $forms->addForm('form', function () {
         $form = new \Form();
         $form['recaptcha'] = $recaptcha = new \WebChemistry\Forms\Controls\Recaptcha();
         $recaptcha->setApiKey('api');
         $recaptcha->setSecretKey('secret');
         return $form;
     });
     $forms->addForm('withoutKeys', function () {
         $form = new \Form();
         $form['recaptcha'] = $recaptcha = new \WebChemistry\Forms\Controls\Recaptcha();
         return $form;
     });
 }
Пример #4
0
<?php

\WebChemistry\Test\Services::presenters()->setMapping('*', 'App\\*Module\\Presenters\\*Presenter');