示例#1
0
 function test_angle_smallerdiff()
 {
     //Arrange
     $test_angle = new Clock();
     $input = 9;
     $input2 = 10;
     $result = $test_angle->angle($input, $input2);
     //Assert
     $this->assertEquals(150, $result);
 }
示例#2
0
文件: app.php 项目: jmalo34/clock
<?php

require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../src/Clock.php';
$app = new Silex\Application();
$app['debug'] = TRUE;
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
$app->get('/', function () use($app) {
    return $app['twig']->render('time.html.twig');
});
$app->get('clock', function () use($app) {
    $my_Clock = new Clock();
    $time = $my_Clock->angle($_GET['hour'], $_GET['minute']);
    return $app['twig']->render('clock.html.twig', array('degrees' => $time));
});
return $app;