/** * @param $ex * @param $a * @param $b * @param $c * @dataProvider calcSquareFigureProvider */ public function testCalcSquareFigure($ex, $a, $b, $c) { $tri = new Triangle(); $tri->setA($a); $tri->setB($b); $tri->setC($c); $tri->calcPerimeterFigure(); $this->assertEquals($ex, $tri->calcSquareFigure()); }
<?php require __DIR__ . '/../config/autoload.php'; use Entity\Triangle; use Layer\Connector\MyConnect; use Layer\Manager\ManagerTriangle; $connect1 = new MyConnect(); $con = $connect1->connect($config['host'], $config['db_user'], $config['db_password'], $config['db_name']); $manTri = new ManagerTriangle($con); $result = $manTri->list_tables($con); $tri = new Triangle(); if (isset($_POST['a'])) { $tri->setA($_POST['a']); } else { $tri->setA(''); } if (isset($_POST['b'])) { $tri->setB($_POST['b']); } else { $tri->setB(''); } if (isset($_POST['c'])) { $tri->setC($_POST['c']); } else { $tri->setC(''); } if (isset($_POST['function'])) { $function = $_POST['function']; } else { $function = ''; }