public function testAttributesToHtml() { $form = new Form(); $form->addAttr('class', 'myClassName mySecondClass')->addAttr(['id' => 'myFormId', 'name' => 'myFormName']); $exposedMethod = $this->makePublic($form, 'attributesToHtml'); $this->assertEquals('class="myClassName mySecondClass" id="myFormId" name="myFormName" ', $exposedMethod->invoke($form)); }
<?php /** * Simple example to how use the class * updated at 09/06/2016 12:00:00 */ require '../vendor/autoload.php'; $form = \HakimCh\Form\Form::init(); ?> <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Form test</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="wrapper"> <div class="debugger right"> <h1>Submitted datas</h1> <div class="code"> <pre>POST : <?php print_r($_POST); ?> </pre> <pre>GET : <?php print_r($_GET); ?> </pre>