function test_rpsGame_mixedInput()
 {
     //Arrange
     $test_Rps = new Rps();
     $player_one = "rock";
     $player_two = "jfkeidl34";
     //Act
     $result = $test_Rps->rpsGame($player_one, $player_two);
     //Assert
     $this->assertEquals("Please enter either rock, paper or scissors", $result);
 }
Exemple #2
0
<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../src/Rps.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('rps.html.twig');
});
$app->get("/results", function () use($app) {
    $results = new Rps();
    $outcome = $results->rpsGame($_GET['player_one'], $_GET['player_two']);
    // $player_one_input = $new_player_one_input->rpsGame($_GET['player_one']);
    return $app['twig']->render('results.html.twig', array('result' => $outcome));
    // return $app['twig']->render('results.html.twig', array('player_one_input' => $player_one_input));
});
return $app;