function test_anagram_true_duplicateLetters()
 {
     //Arrange
     $test_anagram = new AnagramGenerator();
     $input_word = "tact";
     $input_wordsToCheck = "act cat bread bard intact interact protract bob";
     //Act
     $result = $test_anagram->anagramCheck($input_word, $input_wordsToCheck);
     //Assert
     $this->assertEquals("intact interact protract", $result);
 }
Beispiel #2
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/AnagramGenerator.php";
$app = new Silex\Application();
$app['debug'] = true;
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views'));
$app->get("/", function () use($app) {
    return $app['twig']->render('input_form.html.twig');
});
$app->get("/view_matches", function () use($app) {
    $my_AnagramGenerator = new AnagramGenerator();
    $matches = $my_AnagramGenerator->anagramCheck($_GET['keyword'], $_GET['wordlist']);
    $keyword = $_GET['keyword'];
    return $app['twig']->render('view_matches.html.twig', array('result' => $matches, 'keyword' => $keyword));
});
return $app;