function test_addData_skillCheck() { Initial::addData(); $skill = Skill::getAll(); $result = new Skill("Acrobatics", "Balancing and tumbling", 1); $this->assertEquals($skill[0], $result); }
static function find($search_id) { $found_skill = null; $skills = Skill::getAll(); foreach ($skills as $skill) { $skill_id = $skill->getId(); if ($skill_id == $search_id) { $found_skill = $skill; } } return $found_skill; }
function test_deleteAll() { //Arrange $name = "Acrobatics"; $description = "stuff"; $test_class = new Skill($name, $description); $test_class->save(); $name2 = "Athletics"; $description2 = "other stuff"; $test_class2 = new Skill($name2, $description2); $test_class2->save(); //Act Skill::deleteAll(); $result = Skill::getAll(); //Assert $this->assertEquals([], $result); }
<?php include "../inc/cookie.php"; include "../model/User.php"; include "../model/Skill.php"; include "../model/Identity.php"; $User = new User(); $Skill = new Skill(); $Identity = new Identity(); $resultUser = $User->getSingle(); $getUserID = $User->getSingle(); $resultSkill = $Skill->getAllForUser(); $selectSkill = $Skill->getAll(); $resultIdentity = $Identity->getAllForUser(); ?> <div class="row"> <div class="col-md-12"> <h2 class="caps">edit your profile</h2> </div> </div> <div class="row"> <div class="col-md-6 col-centered "> <div class="panel panel-default"> <div class="panel-body" > <h4 class="caps"> <?php while ($User = $resultUser->fetch_object()) { ?> <input type="hidden" id="ID" value="<?php echo $User->ID; ?>