function test_ClockAngleCalculatorF() { //Arrange $test_ClockAngleCalculatorF = new ClockAngle(); $inputHour = 5; $inputMinute = 30; //Act $result = $test_ClockAngleCalculatorF->finalClockAngle(); //Assert $this->assertEquals(30, $result); }
function test_Clock_Angle_min() { //Arrange $test_Clock_Angle = new ClockAngle(); $hour = 9; $minute = 20; //Act $result = $test_Clock_Angle->angle($hour, $minute); //Assert $this->assertEquals(160, $result); }
<?php require_once __DIR__ . "/../vendor/autoload.php"; require_once __DIR__ . "/../src/ClockAngle.php"; $app = new Silex\Application(); $app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views')); $app->get("/", function () use($app) { return $app['twig']->render('form.html.twig'); }); $app->get("/angle", function () use($app) { $myAngle = new ClockAngle(); $finalAngle = $myAngle->angle($_GET['hour'], $_GET['minute']); return $app['twig']->render('angle.html.twig', array('finalAngle' => $finalAngle)); }); return $app;