Exemple #1
1
 function test_makeChange_mixed7()
 {
     //Arrange
     $test_MakeChange = new Coin();
     $input = 7;
     //Act
     $result = $test_MakeChange->makeChange($input);
     //Assert
     $this->assertEquals(array("Quarter" => 0, "Dime" => 0, "Nickel" => 1, "Penny" => 2), $result);
 }
Exemple #2
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/Coin.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("/getcoins", function () use($app) {
    $testNumber = $_GET['money'];
    $coins = new Coin();
    $results = $coins->makeChange($testNumber);
    return $app['twig']->render("index.html.twig", array("coins" => $results));
});
return $app;