Refactored Form.
This commit is contained in:
parent
1fdf9a7ab1
commit
cfe93434ad
45 changed files with 58 additions and 83 deletions
|
|
@ -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()
|
||||
|
|
@ -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()
|
||||
{
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue