示例#1
0
 function test_makeTitleCaser_exclusions()
 {
     //Arrange
     $test_TitleCaserGenerator = new TitleCaserGenerator();
     $input = "the princess and the pea";
     //Act
     $result = $test_TitleCaserGenerator->makeTitleCaser($input);
     //Assert
     $this->assertEquals("The Princess and the Pea", $result);
 }
示例#2
0
文件: app.php 项目: jmalo34/1
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/TitleCaserGenerator.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_title_case", function () use($app) {
    $my_TitleCaserGenerator = new TitleCaserGenerator();
    $title_cased_phrase = $my_TitleCaserGenerator->makeTitleCaser($_GET['phrase']);
    return $app['twig']->render('title_caseRd.html.twig', array('result' => $title_cased_phrase));
});
return $app;