public function testCheck() { $d = new dummy(); $_SERVER["REQUEST_METHOD"] = "POST"; $res = $d->check(array('101A', 'UTN', 45888, 4, 400, 2.3, 'NO', 'Alen', 4789658963)); $this->assertEquals(array('101A', 'UTN', 45888, 4, 400, 2.3, 'NO', 'Alen', 4789658963), $res); //res:OK $res = $d->check(array('101A', 'UTN', 4588998, 4, 400, 2.3, 'NO', 'Alen', 4789658963)); $this->assertEquals("Please fill out a valid zip code.", $res); // res: OK $res = $d->check(array('101A', 'UTN', 4588998, 4, 400, 2.3, 'NO', 'Alen', 4789658963)); $this->assertEquals("Please fill out a valid id.", $res); // res: Failure }
<table border="0" align="center" width = "100" style="font-family:georgia;font-size:15px;"> <tr> <td align="right" width="300" style="padding-right:5px">House Number:</td> <td width="100" align="left"> <input id="hno" style = "height:25px; padding-left:10px;border-radius:5px;" size = "25" type="text" name="f[]" placeholder="House Number" required = "true" /> </td> </tr> <tr> <td colspan = "2"> </td> </tr> </table> <input type="submit" name="submit" value = "Delete" style=" background:#000099;border:none; color:white; font-family:georgia; font-size:14px; height: 25px; width: 100px; border-radius:5px; position:relative; left: 200px; top: 10px;" /> </div> </form>'; } display_form(); display_view(); if (isset($_POST['submit'])) { $formData = $_POST['f']; $fclass = new dummy(); $fclass->check($formData); // $fclass->result(); } echo '</br> </br><a href="pm_home.php" style=" background:#000099; border:none; color:white; font-family:georgia; font-size:20px; height: 25px; width: 100px; border-radius:5px; left: 20px; top: 10px;">Return</a>'; ?> </div> </div> </div> <!-- /#contents --> </body> </html>