function test_addData_skillCheck() { Initial::addData(); $skill = Skill::getAll(); $result = new Skill("Acrobatics", "Balancing and tumbling", 1); $this->assertEquals($skill[0], $result); }
function test_run_maxHpIsThere() { Initial::addData(); $character = Finalize::run(); $id = $character->getStatId(); $stat = Stat::find($id); $max_hp = $stat->getMaxHp(); $result = 11; $this->assertEquals($max_hp, $result); }
if (empty($_SESSION['temporary_character'])) { $_SESSION['temporary_character'] = array($_SESSION['race'] => "", $_SESSION['class'] => "", $_SESSION['background'] => "", $_SESSION['str'] => "", $_SESSION['dex'] => "", $_SESSION['con'] => "", $_SESSION['wis'] => "", $_SESSION['int'] => "", $_SESSION['cha'] => "", $_SESSION['skill'] => "", $_SESSION['name'] => "", $_SESSION['age'] => "", $_SESSION['gender'] => "", $_SESSION['height'] => "", $_SESSION['eye_color'] => "", $_SESSION['hair_color'] => "", $_SESSION['skin_tone'] => "", $_SESSION['alignment'] => "", $_SESSION['other'] => ""); } $app = new Silex\Application(); $app['debug'] = true; $server = 'mysql:host=localhost;dbname=dnd'; $username = '******'; $password = '******'; $DB = new PDO($server, $username, $password); $app->register(new Silex\Provider\TwigServiceProvider(), array('twig.path' => __DIR__ . '/../views')); use Symfony\Component\HttpFoundation\Request; Request::enableHttpMethodParameterOverride(); //landing page //renders homepage $app->get('/', function () use($app) { Initial::addData(); return $app['twig']->render('home.html.twig', array('characters' => Character::getAll())); }); //route to specific character // $app->get('/character_find', function() use ($app) // { // Character::find($id); // // // return $app['twig']->render('summary.html.twig', array('characters' => Character::getAll())); // }); //race page //renders race page $app->get('/race', function () use($app) { return $app['twig']->render('race.html.twig', array('races' => Race::getAll())); });