function test_getCourses()
 {
     //Arrange
     $name = "bob";
     $date_of_enrollment = "2015-09-16";
     $test_student = new Student($name, $date_of_enrollment);
     $test_student->save();
     $name2 = "Psychology 101";
     $course_number = "PSY101";
     $test_course = new Course($name2, $course_number);
     $test_course->save();
     $name3 = "Philosophy 101";
     $course_number2 = "PHIL101";
     $test_course2 = new Course($name3, $course_number2);
     $test_course2->save();
     //Act
     $test_student->addCourse($test_course->getId());
     $test_student->addCourse($test_course2->getId());
     //Assert
     $result = $test_student->getCourses();
     $this->assertEquals([$test_course, $test_course2], $result);
 }
Пример #2
0
 function testGetCourses()
 {
     //Arrange
     $date_enrolled = "2015-10-10";
     $student_name = "Ben Baker Billington";
     $student_id = 1;
     $test_student = new Student($student_name, $date_enrolled, $student_id);
     $test_student->save();
     $course_name2 = "Billy Joe Jim Bob";
     $course_id2 = 2;
     $test_course2 = new Course($course_name2, $date_enrolled, $course_id2);
     $test_course2->save();
     $course_name = "Jammin it, dude";
     $course_number = "102";
     $course_id = 3;
     $test_course = new Course($course_name, $course_number, $course_id);
     $test_course->save();
     //Act
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     //Assert
     $this->assertEquals([$test_course, $test_course2], $test_student->getCourses());
 }
Пример #3
0
 function test_addCourse()
 {
     //Arrange
     $name = "Steve Beekman";
     $date = "2015-08-23";
     $test_student = new Student($name, $date);
     $test_student->save();
     $title = "Intro to Typing: COM-91";
     $teacher = "Ancient Raven";
     $time = "TH 9PM-11PM";
     $semester = "Fall";
     $test_course = new Course($title, $teacher, $time, $semester);
     $test_course->save();
     //Act
     $result = [$test_course];
     $test_student->addCourse($test_course);
     //Assert
     $this->assertEquals($test_student->getCourses(), $result);
 }
    ?>
" />
                                </td>
							</tr>
							<tr>
                                <th>Parent's<br/>Mobile</th>
                                <td><input type="text" maxlength="10" name="parents_mobile" class="form-control" placeholder="parent\'s mobile number" value="<?php 
    echo $t->getParentsMobile();
    ?>
" /></td>
                            </tr>
							<tr>
                                <th>Regular <br/> Courses</th>
				<td>
				<textarea name="courses" class="form-control" placeholder="Regular Courses"><?php 
    echo $t->getCourses();
    ?>
</textarea>
				</td>
							</tr>
							<tr>
                                <th>Load <br/> Courses</th>
                                <td>
				<textarea name="courses_load" class="form-control" placeholder="Load Courses"><?php 
    echo $t->getCoursesLoad();
    ?>
</textarea>
				</td>
							</tr>
							<tr>
                                <th>Total Credit Scored</th>
                                </div><!-- /.box-header -->
                                <div class="box-body table-responsive">
                                    <table id="table1" class="table table-bordered table-striped">
                                        <thead>
                                            <tr>
                                                <th>Course Code</th>
                                                <th>Course Name</th>
                                                <th>Classes Attended</th>
                                                <th>Total Classes</th>
                                                <th>Attendance Percentage*</th>
                                                <th>Last Update</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        	<?php 
$courses = $s->getCourses();
$courses = explode(',', $courses);
foreach ($courses as $course) {
    ?>
                                        	<tr>
                                        	<td><?php 
    echo $course;
    ?>
</td>
                                        	<td>
                                        		<?php 
    $c = new Course();
    $c->getInfobyId($course);
    echo $c->getCourseName();
    unset($c);
    $a = new Attendance();
 function testGetCourses()
 {
     //Arrange
     $id = null;
     $name = "Intro to Math";
     $number = "MATH100";
     $test_course = new Course($id, $name, $number);
     $test_course->save();
     $id2 = null;
     $name2 = "Underwater Basketweaving";
     $number2 = "BS133";
     $test_course2 = new Course($id2, $name2, $number2);
     $test_course2->save();
     $id3 = null;
     $student_name = "Billy";
     $enroll_date = "2015-09-18";
     $test_student = new Student($id3, $student_name, $enroll_date);
     $test_student->save();
     //Act
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     //Assert
     $this->assertEquals([$test_course, $test_course2], $test_student->getCourses());
 }
Пример #7
0
 function testGetCourses()
 {
     //Arrange
     $name = "Math";
     $course_num = "101";
     $id = 1;
     $test_course = new Course($name, $course_num, $id);
     $test_course->save();
     $name2 = "English";
     $course_num2 = "200";
     $id2 = 2;
     $test_course2 = new Course($name2, $course_num2, $id2);
     $test_course2->save();
     $name = "Rick";
     $date = "2015-08-15";
     $id = 1;
     $test_student = new Student($name, $date, $id);
     $test_student->save();
     //Act
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     $result = $test_student->getCourses();
     //Assert
     $this->assertEquals([$test_course, $test_course2], $result);
 }
 function test_getCourses()
 {
     //Arrange
     $name = "History of Rugs";
     $course_number = "200";
     $id = 1;
     $test_course = new Course($name, $course_number, $id);
     $test_course->save();
     $name2 = "White Russians";
     $course_number2 = "400";
     $id2 = 2;
     $test_course2 = new Course($name2, $course_number2, $id2);
     $test_course2->save();
     $student_name = "Donnie";
     $enrollment_date = "yesterday";
     $id3 = 3;
     $test_student = new Student($student_name, $enrollment_date, $id3);
     $test_student->save();
     //Act
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     $result = $test_student->getCourses();
     var_dump($result);
     //Assert
     $this->assertEquals([$test_course, $test_course2], $result);
 }
 function testAddCourse()
 {
     $name = "Jimmy";
     $enrollment_date = "2015";
     $test_student = new Student($name, $enrollment_date);
     $test_student->save();
     $course_name = "Real Analysis I";
     $course_number = "Math 540";
     $test_course = new Course($course_name, $course_number);
     $test_course->save();
     $test_student->addCourse($test_course);
     $this->assertEquals([$test_course], $test_student->getCourses());
 }
 function test_addCourse_and_getCourses()
 {
     $name = "Western Civ";
     $number = "HST 101";
     $test_course = new Course($name, $number);
     $test_course->save();
     $name2 = "Remedial Math";
     $number2 = "MTH 64";
     $test_course2 = new Course($name2, $number2);
     $test_course2->save();
     $name = "Chris";
     $date = "1111-11-11";
     $test_student = new Student($name, $date);
     $test_student->save();
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     $this->assertEquals($test_student->getCourses(), [$test_course, $test_course2]);
 }
 function testGetCourses()
 {
     $name = "Bob";
     $enrollment_date = "2015-01-01";
     $test_student = new Student($name, $enrollment_date);
     $test_student->save();
     $course_name = "History";
     $course_number = "HIST100";
     $test_course = new Course($course_name, $course_number);
     $test_course->save();
     $course_name2 = "Math";
     $course_number2 = "MATH100";
     $test_course2 = new Course($course_name, $course_number);
     $test_course2->save();
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     $this->assertEquals($test_student->getCourses(), [$test_course, $test_course2]);
 }
Пример #12
0
 function testGetCourse()
 {
     //Arrange
     $course_name = "Intro to Art";
     $course_number = "ART101";
     $id = 1;
     $test_course = new Course($course_name, $course_number, $id);
     $test_course->save();
     $course_name2 = "Intro to Spanish";
     $course_number2 = "SPN101";
     $id2 = 2;
     $test_course2 = new Course($course_name2, $course_number2, $id2);
     $test_course2->save();
     $name = "Ben";
     $enroll_date = "0000-00-00";
     $id = 1;
     $test_student = new Student($name, $enroll_date, $id);
     $test_student->save();
     //Act
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     //Assert
     $this->assertEquals($test_student->getCourses(), [$test_course, $test_course2]);
 }
 function test_getCourses()
 {
     //Arrange
     $course_name = "Being a bum";
     $id = 1;
     $test_course = new Course($course_name, $id);
     $test_course->save();
     $course_name2 = "Getting a toe";
     $id2 = 2;
     $test_course2 = new Course($course_name2, $id2);
     $test_course2->save();
     $student_name = "Jeff Lebowski";
     $id3 = 3;
     $test_student = new Student($student_name, $id3);
     $test_student->save();
     //Act
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     //Assert
     $this->assertEquals($test_student->getCourses(), [$test_course, $test_course2]);
 }
 function testGetCourses()
 {
     $student_name = "John Doe";
     $enrollment_date = "2015-09-01";
     $test_student = new Student($student_name, $enrollment_date);
     $test_student->save();
     $course_name = "History";
     $course_code = "HIST100";
     $test_course = new Course($course_name, $course_code);
     $test_course->save();
     $course_name2 = "Gym";
     $course_code2 = "GYM100";
     $test_course2 = new Course($course_name2, $course_code2);
     $test_course2->save();
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     $this->assertEquals($test_student->getCourses(), [$test_course2, $test_course]);
 }
Пример #15
0
 function testGetCourses()
 {
     //Arrange
     $name = "Biology 101";
     $number = 101;
     $id = 1;
     $test_course = new Course($name, $number, $id);
     $test_course->save();
     $name2 = "Physics";
     $number2 = 101;
     $id2 = 2;
     $test_course2 = new Course($name2, $number2, $id2);
     $test_course2->save();
     $name = "Elliot Michaels";
     $date = "2015-08-03";
     $id = 1;
     $test_student = new Student($name, $date, $id);
     $test_student->save();
     //Act
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     //Assert
     $this->assertEquals($test_student->getCourses(), [$test_course, $test_course2]);
 }
Пример #16
0
 function test_getCourses()
 {
     //Arrange
     $test_student = new Student("Shmuel Irving-Jones", "2015-08-25");
     $test_student->save();
     $test_student2 = new Student("Billy Bartle-Barnaby", "2015-07-09");
     $test_student2->save();
     $test_course = new Course("High Times", "CHEM420");
     $test_course->save();
     $test_course2 = new Course("Gavanese Jamelan", "MUSC69");
     $test_course2->save();
     //Act
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     $test_student2->addCourse($test_course2);
     //Assert
     $this->assertEquals($test_student->getCourses(), [$test_course, $test_course2]);
 }
 function test_addCourse()
 {
     //Arrange
     $name = "bowling";
     $id = 1;
     $course_number = "400";
     $test_course = new Course($name, $course_number, $id);
     $test_course->save();
     $name2 = "Lebowski";
     $enrollment_date = "2015-12-12";
     $id2 = 2;
     $test_student = new Student($name2, $enrollment_date, $id2);
     $test_student->save();
     //Act
     $test_student->addCourse($test_course);
     $result = $test_student->getCourses();
     //Assert
     $this->assertEquals([$test_course], $result);
 }
Пример #18
0
 function test_addCourse()
 {
     //Arrange
     $course_name = "MTH101";
     $crn = 1234;
     $id = 1;
     $test_course = new Course($course_name, $crn, $id);
     $test_course->save();
     $student_name = "Bob";
     $enroll_date = "2012-10-20";
     $id2 = 2;
     $test_student = new Student($student_name, $enroll_date, $id2);
     $test_student->save();
     //Act
     $test_student->addCourse($test_course);
     //Assert
     $this->assertEquals($test_student->getCourses(), [$test_course]);
 }
 function testGetCourse()
 {
     //Arrange
     $course_name = "History";
     $id = 1;
     $crn = "HIST101";
     $test_course = new Course($course_name, $crn, $id);
     $test_course->save();
     $course_name2 = "Economics";
     $id2 = 2;
     $crn = "ECON101";
     $test_course2 = new Course($course_name2, $crn, $id2);
     $test_course2->save();
     $student_name = "Paco";
     $id3 = 3;
     $enroll_date = "2015-06-22";
     $test_student = new Student($student_name, $enroll_date, $id3);
     $test_student->save();
     //Act
     $test_student->addCourse($test_course);
     $test_student->addCourse($test_course2);
     //Assert
     $this->assertEquals($test_student->getCourses(), [$test_course, $test_course2]);
 }
 function test_deleteAllCourses()
 {
     //Arrange
     $name = "Wesley Pong";
     $enrollment_date = "2015-09-09";
     $id = 1;
     $test_student = new Student($name, $enrollment_date, $id);
     $test_student->save();
     $course_name = "History";
     $id2 = 2;
     $course_number = 'HIST:101';
     $test_course = new Course($course_name, $course_number, $id2);
     $test_course->save();
     $course_name2 = "Lit";
     $id3 = 3;
     $course_number2 = 'Lit:101';
     $test_course2 = new Course($course_name2, $course_number2, $id3);
     $test_course2->save();
     $test_student->addCourse($test_course->getId());
     $test_student->addCourse($test_course2->getId());
     //Act
     $test_student->deleteAllCourses();
     $result = $test_student->getCourses();
     //Assert
     $this->assertEquals([], $result);
 }