function test_anagramFinder_onlyAnagram() { //Arrange $test_Anagram = new Anagram(); $word = "cool"; $list = "loco, milk, cool"; //Act $result = $test_Anagram->anagramFinder($word, $list); //Assert $this->assertEquals("loco", $result); }
<?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')); $app->get("/", function () use($app) { return $app['twig']->render('form.html.twig'); }); $app->get("/view_anagrams", function () use($app) { $my_Anagram = new Anagram(); $your_anagrams = $my_Anagram->anagramFinder($_GET['word'], $_GET['list']); return $app['twig']->render('view.html.twig', array('result' => $your_anagrams)); }); return $app;