Esempio n. 1
0
 function test_outputSFirst()
 {
     //arrange
     $test_LeetSpeak = new LeetSpeak();
     $input = "She sings Sassy Say sings Sassy";
     //act
     $result = $test_LeetSpeak->toLeetSpeak($input);
     //assert
     $this->assertEquals("Sh3 singz Sazzy Say singz Sazzy", $result);
 }
Esempio n. 2
0
 function test_makeLeetSpeak_o()
 {
     //Arrange
     $test_LeetSpeak = new LeetSpeak();
     $input = "Woop";
     //Act
     $result = $test_LeetSpeak->makeLeetSpeak($input);
     //Assert
     $this->assertEquals("W00p", $result);
 }
Esempio n. 3
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/LeetSpeak.php";
session_start();
$app = new Silex\Application();
$app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . "/../views"));
$app->get("/", function () use($app) {
    return $app['twig']->render('index.html.twig');
});
$app->get("/LeetSpeak", function () use($app) {
    $newLeetSpeak = new LeetSpeak();
    $result = $newLeetSpeak->toLeetSpeak($_GET['words']);
    return $app['twig']->render('index.html.twig', array('leet' => $result));
});
return $app;
Esempio n. 4
0
 function test_leetSpeak_mult_wordss()
 {
     //Arrange
     $test_LeetSpeak = new LeetSpeak();
     $input = "Start Epicodus Homework";
     //Act
     $result = $test_LeetSpeak->makeLeetSpeak($input);
     //Assert
     $this->assertEquals('Start 3pic0duz H0m3w0rk', $result);
 }
Esempio n. 5
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/LeetSpeak.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_leet_speak", function () use($app) {
    $my_LeetSpeak = new LeetSpeak();
    $leet_speak_phrase = $my_LeetSpeak->makeLeetSpeak($_GET['phrase']);
    return $app['twig']->render('leet_speak.html.twig', array('result' => $leet_speak_phrase));
});
return $app;