Пример #1
0
 function test_scrabbleScore_differentMultipleLetterValue()
 {
     //Arrange
     $test_Scrabble = new Scrabble();
     $input = "AppLe";
     //Act
     $result = $test_Scrabble->scrabbleScore($input);
     //Assert
     $this->assertEquals(9, $result);
 }
Пример #2
0
 function test_scrabbleScore_multiple_letters()
 {
     //Arrange
     $test_Scrabble = new Scrabble();
     $input = "word";
     //Act
     $calculatedScore = $test_Scrabble->scrabbleScore($input);
     //Assert
     $this->assertEquals("8", $calculatedScore);
 }
Пример #3
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('form.html.twig');
});
$app->get("/score", function () use($app) {
    $my_Score = new Scrabble();
    $your_score = $my_Score->scrabbleScore($_GET['word']);
    return $app['twig']->render('score.html.twig', array('score' => $your_score));
});
return $app;
Пример #4
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('scrabble.html.twig');
});
$app->get("/results", function () use($app) {
    $results = new Scrabble();
    $outcome = $results->scrabbleScore($_GET['word_form']);
    return $app['twig']->render('results.html.twig', array('result' => $outcome));
});
return $app;