Example #1
0
 function test_multiple_words()
 {
     $test_Scrabble = new Scrabble();
     $input = "Hello World";
     $result = $test_Scrabble->scrabbleGame($input);
     $this->assertEquals("Error Message", $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'));
//Main Page
$app->get("/", function () use($app) {
    return $app['twig']->render('scrabblehome.html.twig');
});
$app->get("/score_check", function () use($app) {
    $new_Scrabble = new Scrabble();
    $score = $new_Scrabble->scrabbleGame($_GET['word']);
    return $app['twig']->render('scrabblehome.html.twig', array('result' => $score));
});
return $app;