function testNinetynineCents()
 {
     //Arrange
     $test = new CoinCombination();
     $change_to_make = 99;
     //Act
     $result = $test->makeChange($change_to_make);
     //Assert
     $this->assertEquals("Quarters: 3 Dimes: 2 Nickels: 0 Pennies: 4", $result);
 }
Esempio n. 2
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/CoinCombination.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('home_page.html.twig');
});
$app->get("/coin_combination", function () use($app) {
    $coin_selector = new CoinCombination();
    $coin_combination = $coin_selector->makeChange($_GET['amount']);
    return $app['twig']->render('coin_combination_results.html.twig', array('result' => $coin_combination));
});
return $app;