diff options
author | Willy Micieli <micieli@laposte.net> | 2019-11-02 09:48:50 +0100 |
---|---|---|
committer | Willy Micieli <micieli@laposte.net> | 2019-11-02 09:48:50 +0100 |
commit | e595c1b42c673c52aaa7d6c2ad2942f5396a05c6 (patch) | |
tree | 180d1e4c3543b2f5a5f5bc6ed7e6243e4458a1b9 | |
parent | 6e65cd09955364fcfee7516f00b988fd94e22f0b (diff) | |
download | imperium-e595c1b42c673c52aaa7d6c2ad2942f5396a05c6.zip imperium-e595c1b42c673c52aaa7d6c2ad2942f5396a05c6.tar.gz |
add tests
-rw-r--r-- | imperium/Html/Form/Form.php | 3 | ||||
-rw-r--r-- | tests/FormTest.php (renamed from tests/FormTests.php) | 14 |
2 files changed, 14 insertions, 3 deletions
diff --git a/imperium/Html/Form/Form.php b/imperium/Html/Form/Form.php index dbf1149..4e5786b 100644 --- a/imperium/Html/Form/Form.php +++ b/imperium/Html/Form/Form.php @@ -2,13 +2,12 @@ namespace Imperium\Html\Form {
- use DateTime;
use DI\DependencyException;
use DI\NotFoundException;
use Imperium\App;
use Imperium\Collection\Collect;
use Imperium\Exception\Kedavra;
- use function DI\value;
+
class Form
{
diff --git a/tests/FormTests.php b/tests/FormTest.php index bf53b53..0164439 100644 --- a/tests/FormTests.php +++ b/tests/FormTest.php @@ -10,7 +10,7 @@ use Imperium\Exception\Kedavra; use Imperium\Html\Form\Form; use Imperium\Testing\Unit; -class FormTests extends Unit +class FormTest extends Unit { /** * @var Form @@ -27,6 +27,7 @@ class FormTests extends Unit $this->form = new Form('POST','admin','create',['users']); } + /** * @throws Kedavra */ @@ -50,8 +51,19 @@ class FormTests extends Unit { $this->assertNotEmpty($this->form->edit('users',50)); $this->assertStringContainsString('50',$this->form->edit('users',50)); + $this->assertStringContainsString('50',$this->form->edit('countries',50)); + } + + public function test_generate() + { + $this->assertNotEmpty($this->form->generate('users')); + $this->assertNotEmpty($this->form->generate('countries')); } + public function test_select() + { + $this->assertStringContainsString('user',$this->form->row()->select('user',['user'])->end()->get()); + } /** * @throws Kedavra |