Refactored Form.

This commit is contained in:
Dmitry Khomutov 2018-03-04 17:50:08 +07:00
commit cfe93434ad
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
45 changed files with 58 additions and 83 deletions

View file

@ -1,8 +1,8 @@
<?php
namespace Tests\b8;
namespace Tests\PHPCensor;
use b8\Form;
use PHPCensor\Form;
use PHPCensor\Config;
class FormTest extends \PHPUnit\Framework\TestCase
@ -15,20 +15,6 @@ class FormTest extends \PHPUnit\Framework\TestCase
self::assertTrue($f->getAction() == '/');
self::assertTrue($f->getMethod() == 'POST');
new Config([
'b8' => [
'view' => [
'path' => __DIR__ . '/data/view/'
]
]
]);
self::assertTrue($f->render('form') == '/POST');
Config::getInstance()->set('b8.view.path', '');
self::assertTrue(strpos((string)$f, '<form') !== false);
}
public function testElementBasics()

View file

@ -1,11 +1,10 @@
<?php
namespace Tests\b8;
namespace Tests\PHPCensor;
use PHPCensor\View;
use PHPUnit\Framework\TestCase;
class ViewTest extends TestCase
class ViewTest extends \PHPUnit\Framework\TestCase
{
public function testSimpleView()
{

View file

@ -30,7 +30,6 @@ $conf = [];
$conf['b8']['app']['namespace'] = 'PHPCensor';
$conf['b8']['app']['default_controller'] = 'Home';
$conf['b8']['view']['path'] = SRC_DIR . 'View/';
$conf['php-censor']['url'] = 'http://php-censor.local';
$config = new PHPCensor\Config($conf);