Example #1
0
 function test_invalid_input()
 {
     $test = new Scrabble();
     $input = "encycl2";
     $result = $test->score($input);
     $this->assertEquals("Error not valid input", $result);
 }
Example #2
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/Scrabble.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("/scrabble_score", function () use($app) {
    $game = new Scrabble();
    $scra_score = $game->score($_GET['word']);
    return $app['twig']->render('scrabble_score.html.twig', array('score' => $scra_score));
});
return $app;