function test_scrabbleScore_differentMultipleLetterValue() { //Arrange $test_Scrabble = new Scrabble(); $input = "AppLe"; //Act $result = $test_Scrabble->scrabbleScore($input); //Assert $this->assertEquals(9, $result); }
function test_scrabbleScore_multiple_letters() { //Arrange $test_Scrabble = new Scrabble(); $input = "word"; //Act $calculatedScore = $test_Scrabble->scrabbleScore($input); //Assert $this->assertEquals("8", $calculatedScore); }
<?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;
<?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;