コード例 #1
0
ファイル: InitialTest.php プロジェクト: civilianemail/dnd
 function test_addData_skillCheck()
 {
     Initial::addData();
     $skill = Skill::getAll();
     $result = new Skill("Acrobatics", "Balancing and tumbling", 1);
     $this->assertEquals($skill[0], $result);
 }
コード例 #2
0
ファイル: Skill.php プロジェクト: civilianemail/dnd
 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;
 }
コード例 #3
0
ファイル: SkillTest.php プロジェクト: civilianemail/dnd
 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);
 }
コード例 #4
0
ファイル: editprofile.php プロジェクト: jschouwstra/match-up
<?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;
    ?>