function test_anagramMatch_multipleWords() { //Arrange $test_Anagram = new Anagram(); $input = "cat"; $input_list = 'cat act tac'; //Act: runs the actual method that we are testing. $result = $test_Anagram->anagramMatch($input, $input_list); $result2 = $test_Anagram->anagramMatch($input, $input_list); $result3 = $test_Anagram->anagramMatch($input, $input_list); //Assert tells our tests what to expect from the output of our method. $this->assertEquals(true, $result); $this->assertEquals(true, $result2); $this->assertEquals(true, $result3); }
<?php require_once __DIR__ . "/../vendor/autoload.php"; require_once __DIR__ . "/../src/Anagram.php"; $app = new Silex\Application(); $app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views')); // End busy code -----------^ // Render Home Page $app->get("/", function () use($app) { return $app['twig']->render('anagram.html.twig'); // }); // Grabs User Input $app->get("/userInput", function () use($app) { $input_word = $_GET['word']; $input_list = $_GET['list']; $input_array = explode(" ", $input_list); $my_anagram = new Anagram(); $results_bool = $my_anagram->anagramMatch($input_word, $input_list); $results_match = $my_anagram->getMatchResultArray(); // calls the function to get array $results_fail = $my_anagram->getFailResultArray(); return $app['twig']->render('anagram.html.twig', array('input' => $input_word, 'list' => $input_array, 'results' => $results_bool, 'match' => $results_match, 'fail' => $results_fail)); }); return $app;