|
@@ -0,0 +1,40 @@
|
|
|
+<?php
|
|
|
+/**
|
|
|
+ * Created by PhpStorm.
|
|
|
+ * User: mrs
|
|
|
+ * Date: 15.01.2018
|
|
|
+ * Time: 16:54
|
|
|
+ */
|
|
|
+
|
|
|
+namespace Test;
|
|
|
+
|
|
|
+use App\Model\Student;
|
|
|
+use PHPUnit\Framework\TestCase;
|
|
|
+
|
|
|
+
|
|
|
+include_once('repository/RepositoryAbstract.php');
|
|
|
+include_once('repository/StudentRepository.php');
|
|
|
+include_once('model/Student.php');
|
|
|
+include_once('config/DbConnection.php');
|
|
|
+
|
|
|
+class StudentTests extends TestCase
|
|
|
+{
|
|
|
+
|
|
|
+ public function testShortFirstnameValidation()
|
|
|
+ {
|
|
|
+ $student = new Student('a', 'lastname', '3-A');
|
|
|
+ $this->assertFalse($student->validate());
|
|
|
+ }
|
|
|
+
|
|
|
+ public function testShortLastnameValidation()
|
|
|
+ {
|
|
|
+ $student = new Student('firstname', 'b', '3-A');
|
|
|
+ $this->assertFalse($student->validate());
|
|
|
+ }
|
|
|
+
|
|
|
+ public function testShortClassValidation()
|
|
|
+ {
|
|
|
+ $student = new Student('firstname', 'lastname', '3');
|
|
|
+ $this->assertFalse($student->validate());
|
|
|
+ }
|
|
|
+}
|