function test_mix_character() { //Arrange $test_case = new Scrabble(); $user_input = "c!@#a%\$#t"; //Act $result = $test_case->scoreCal($user_input); //Assert $this->assertEquals(5, $result); }
<?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')); // Home twig link $app->get("/", function () use($app) { return $app['twig']->render('index.html.twig'); }); $app->post("/results", function () use($app) { $new_Scrabble = new Scrabble(); $results = $new_Scrabble->scoreCal($_POST['input']); return $app['twig']->render('results.html.twig', array('result' => $results)); }); return $app;