Пример #1
0
 function test_for_pennies()
 {
     //Arrange
     $test_user_input = new Change();
     $user_change = 4;
     //Act
     $result = $test_user_input->giveChange($user_change);
     //Assert
     $this->assertEquals([0, 0, 0, 4], $result);
 }
Пример #2
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/Anagram.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("/change", function () use($app) {
    $myChange = new Change();
    $output = $myChange->giveChange($_GET['change']);
    return $app['twig']->render('change.html.twig', array('output' => $output));
});
return $app;