function test_angleBetweenHands_all()
 {
     // arrange
     $test_Clock = new Clock();
     $input_time = '10:30';
     $input_time2 = '12:30';
     $input_time3 = '1:07';
     // act
     $result = $test_Clock->angleBetweenHands($input_time);
     $result2 = $test_Clock->angleBetweenHands($input_time2);
     $result3 = $test_Clock->angleBetweenHands($input_time3);
     // assert
     $this->assertEquals(135, $result);
     $this->assertEquals(165, $result2);
     $this->assertEquals(8.5, $result3);
 }
Example #2
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/Clock.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('index.html.twig');
});
$app->get("/angle", function () use($app) {
    $my_Clock = new Clock();
    $results = $my_Clock->angleBetweenHands($_GET['time']);
    return $app['twig']->render('index.html.twig', array('result' => $results));
});
return $app;