recreate project

This commit is contained in:
root
2026-02-10 22:11:06 -05:00
commit 663c0cdbda
10149 changed files with 1379710 additions and 0 deletions
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\AttendanceDataModel;
class AttendanceDataModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(AttendanceDataModel::class);
$this->assertNotNull($record->id);
$fetched = (new AttendanceDataModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(AttendanceDataModel::class);
$model = new AttendanceDataModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(AttendanceDataModel::class);
$model = new AttendanceDataModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\AttendanceRecordModel;
class AttendanceRecordModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(AttendanceRecordModel::class);
$this->assertNotNull($record->id);
$fetched = (new AttendanceRecordModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(AttendanceRecordModel::class);
$model = new AttendanceRecordModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(AttendanceRecordModel::class);
$model = new AttendanceRecordModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\AuthorizedUserModel;
class AuthorizedUserModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(AuthorizedUserModel::class);
$this->assertNotNull($record->id);
$fetched = (new AuthorizedUserModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(AuthorizedUserModel::class);
$model = new AuthorizedUserModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(AuthorizedUserModel::class);
$model = new AuthorizedUserModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\CalendarModel;
class CalendarModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(CalendarModel::class);
$this->assertNotNull($record->id);
$fetched = (new CalendarModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(CalendarModel::class);
$model = new CalendarModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(CalendarModel::class);
$model = new CalendarModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\ClassModel;
class ClassModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(ClassModel::class);
$this->assertNotNull($record->id);
$fetched = (new ClassModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(ClassModel::class);
$model = new ClassModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(ClassModel::class);
$model = new ClassModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\ClassSectionModel;
class ClassSectionModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(ClassSectionModel::class);
$this->assertNotNull($record->id);
$fetched = (new ClassSectionModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(ClassSectionModel::class);
$model = new ClassSectionModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(ClassSectionModel::class);
$model = new ClassSectionModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\ConfigurationModel;
class ConfigurationModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(ConfigurationModel::class);
$this->assertNotNull($record->id);
$fetched = (new ConfigurationModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(ConfigurationModel::class);
$model = new ConfigurationModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(ConfigurationModel::class);
$model = new ConfigurationModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\ContactUsModel;
class ContactUsModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(ContactUsModel::class);
$this->assertNotNull($record->id);
$fetched = (new ContactUsModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(ContactUsModel::class);
$model = new ContactUsModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(ContactUsModel::class);
$model = new ContactUsModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\CurrentFlagModel;
class CurrentFlagModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(CurrentFlagModel::class);
$this->assertNotNull($record->id);
$fetched = (new CurrentFlagModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(CurrentFlagModel::class);
$model = new CurrentFlagModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(CurrentFlagModel::class);
$model = new CurrentFlagModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\EmergencyContactModel;
class EmergencyContactModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(EmergencyContactModel::class);
$this->assertNotNull($record->id);
$fetched = (new EmergencyContactModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(EmergencyContactModel::class);
$model = new EmergencyContactModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(EmergencyContactModel::class);
$model = new EmergencyContactModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\EnrollmentModel;
class EnrollmentModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(EnrollmentModel::class);
$this->assertNotNull($record->id);
$fetched = (new EnrollmentModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(EnrollmentModel::class);
$model = new EnrollmentModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(EnrollmentModel::class);
$model = new EnrollmentModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\EventModel;
class EventModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(EventModel::class);
$this->assertNotNull($record->id);
$fetched = (new EventModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(EventModel::class);
$model = new EventModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(EventModel::class);
$model = new EventModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\ExamModel;
class ExamModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(ExamModel::class);
$this->assertNotNull($record->id);
$fetched = (new ExamModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(ExamModel::class);
$model = new ExamModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(ExamModel::class);
$model = new ExamModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\FinalExamModel;
class FinalExamModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(FinalExamModel::class);
$this->assertNotNull($record->id);
$fetched = (new FinalExamModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(FinalExamModel::class);
$model = new FinalExamModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(FinalExamModel::class);
$model = new FinalExamModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\FinalScoreModel;
class FinalScoreModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(FinalScoreModel::class);
$this->assertNotNull($record->id);
$fetched = (new FinalScoreModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(FinalScoreModel::class);
$model = new FinalScoreModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(FinalScoreModel::class);
$model = new FinalScoreModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\FlagModel;
class FlagModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(FlagModel::class);
$this->assertNotNull($record->id);
$fetched = (new FlagModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(FlagModel::class);
$model = new FlagModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(FlagModel::class);
$model = new FlagModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\HomeworkModel;
class HomeworkModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(HomeworkModel::class);
$this->assertNotNull($record->id);
$fetched = (new HomeworkModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(HomeworkModel::class);
$model = new HomeworkModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(HomeworkModel::class);
$model = new HomeworkModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\InvoiceModel;
class InvoiceModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(InvoiceModel::class);
$this->assertNotNull($record->id);
$fetched = (new InvoiceModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(InvoiceModel::class);
$model = new InvoiceModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(InvoiceModel::class);
$model = new InvoiceModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\InvoiceStudentListModel;
class InvoiceStudentListModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(InvoiceStudentListModel::class);
$this->assertNotNull($record->id);
$fetched = (new InvoiceStudentListModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(InvoiceStudentListModel::class);
$model = new InvoiceStudentListModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(InvoiceStudentListModel::class);
$model = new InvoiceStudentListModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\LoginActivityModel;
class LoginActivityModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(LoginActivityModel::class);
$this->assertNotNull($record->id);
$fetched = (new LoginActivityModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(LoginActivityModel::class);
$model = new LoginActivityModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(LoginActivityModel::class);
$model = new LoginActivityModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\MessageModel;
class MessageModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(MessageModel::class);
$this->assertNotNull($record->id);
$fetched = (new MessageModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(MessageModel::class);
$model = new MessageModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(MessageModel::class);
$model = new MessageModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\MidtermExamModel;
class MidtermExamModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(MidtermExamModel::class);
$this->assertNotNull($record->id);
$fetched = (new MidtermExamModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(MidtermExamModel::class);
$model = new MidtermExamModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(MidtermExamModel::class);
$model = new MidtermExamModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,50 @@
<?php
use App\Models\NotificationModel;
use CodeIgniter\Test\CIUnitTestCase;
class NotificationModelTest extends CIUnitTestCase
{
protected $model;
protected function setUp(): void
{
parent::setUp();
$this->model = new NotificationModel();
}
public function testGetActiveNotifications()
{
$result = $this->model->getActiveNotifications();
$this->assertIsArray($result);
}
public function testGetDeletedNotifications()
{
$result = $this->model->getDeletedNotifications();
$this->assertIsArray($result);
}
public function testRestoreNotification()
{
// Create + soft delete a test record
$id = $this->model->insert([
'title' => 'Test restore',
'message' => 'Test message',
'target_group' => 'parent',
'delivery_channels' => 'in_app',
'priority' => 'normal',
'status' => 'sent',
'scheduled_at' => date('Y-m-d H:i:s'),
]);
$this->model->delete($id);
$this->assertNotNull($this->model->onlyDeleted()->find($id));
// Restore
$this->model->restoreNotification($id);
$this->assertNull($this->model->onlyDeleted()->find($id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\ParentModel;
class ParentModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(ParentModel::class);
$this->assertNotNull($record->id);
$fetched = (new ParentModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(ParentModel::class);
$model = new ParentModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(ParentModel::class);
$model = new ParentModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\ParticipationModel;
class ParticipationModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(ParticipationModel::class);
$this->assertNotNull($record->id);
$fetched = (new ParticipationModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(ParticipationModel::class);
$model = new ParticipationModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(ParticipationModel::class);
$model = new ParticipationModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\PasswordResetModel;
class PasswordResetModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(PasswordResetModel::class);
$this->assertNotNull($record->id);
$fetched = (new PasswordResetModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(PasswordResetModel::class);
$model = new PasswordResetModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(PasswordResetModel::class);
$model = new PasswordResetModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\PaymentModel;
class PaymentModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(PaymentModel::class);
$this->assertNotNull($record->id);
$fetched = (new PaymentModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(PaymentModel::class);
$model = new PaymentModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(PaymentModel::class);
$model = new PaymentModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\PaymentTransactionModel;
class PaymentTransactionModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(PaymentTransactionModel::class);
$this->assertNotNull($record->id);
$fetched = (new PaymentTransactionModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(PaymentTransactionModel::class);
$model = new PaymentTransactionModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(PaymentTransactionModel::class);
$model = new PaymentTransactionModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\PaypalTransactionModel;
class PaypalTransactionModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(PaypalTransactionModel::class);
$this->assertNotNull($record->id);
$fetched = (new PaypalTransactionModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(PaypalTransactionModel::class);
$model = new PaypalTransactionModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(PaypalTransactionModel::class);
$model = new PaypalTransactionModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\PermissionModel;
class PermissionModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(PermissionModel::class);
$this->assertNotNull($record->id);
$fetched = (new PermissionModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(PermissionModel::class);
$model = new PermissionModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(PermissionModel::class);
$model = new PermissionModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\PreferencesModel;
class PreferencesModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(PreferencesModel::class);
$this->assertNotNull($record->id);
$fetched = (new PreferencesModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(PreferencesModel::class);
$model = new PreferencesModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(PreferencesModel::class);
$model = new PreferencesModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\ProjectModel;
class ProjectModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(ProjectModel::class);
$this->assertNotNull($record->id);
$fetched = (new ProjectModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(ProjectModel::class);
$model = new ProjectModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(ProjectModel::class);
$model = new ProjectModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\QuizModel;
class QuizModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(QuizModel::class);
$this->assertNotNull($record->id);
$fetched = (new QuizModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(QuizModel::class);
$model = new QuizModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(QuizModel::class);
$model = new QuizModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\RoleModel;
class RoleModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(RoleModel::class);
$this->assertNotNull($record->id);
$fetched = (new RoleModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(RoleModel::class);
$model = new RoleModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(RoleModel::class);
$model = new RoleModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\RolePermissionModel;
class RolePermissionModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(RolePermissionModel::class);
$this->assertNotNull($record->id);
$fetched = (new RolePermissionModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(RolePermissionModel::class);
$model = new RolePermissionModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(RolePermissionModel::class);
$model = new RolePermissionModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\ScoreModel;
class ScoreModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(ScoreModel::class);
$this->assertNotNull($record->id);
$fetched = (new ScoreModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(ScoreModel::class);
$model = new ScoreModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(ScoreModel::class);
$model = new ScoreModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\SectionModel;
class SectionModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(SectionModel::class);
$this->assertNotNull($record->id);
$fetched = (new SectionModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(SectionModel::class);
$model = new SectionModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(SectionModel::class);
$model = new SectionModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\SemesterScoreModel;
class SemesterScoreModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(SemesterScoreModel::class);
$this->assertNotNull($record->id);
$fetched = (new SemesterScoreModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(SemesterScoreModel::class);
$model = new SemesterScoreModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(SemesterScoreModel::class);
$model = new SemesterScoreModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\SettingsModel;
class SettingsModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(SettingsModel::class);
$this->assertNotNull($record->id);
$fetched = (new SettingsModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(SettingsModel::class);
$model = new SettingsModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(SettingsModel::class);
$model = new SettingsModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\StatsModel;
class StatsModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(StatsModel::class);
$this->assertNotNull($record->id);
$fetched = (new StatsModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(StatsModel::class);
$model = new StatsModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(StatsModel::class);
$model = new StatsModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\StudentClassModel;
class StudentClassModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(StudentClassModel::class);
$this->assertNotNull($record->id);
$fetched = (new StudentClassModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(StudentClassModel::class);
$model = new StudentClassModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(StudentClassModel::class);
$model = new StudentClassModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\StudentModel;
class StudentModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(StudentModel::class);
$this->assertNotNull($record->id);
$fetched = (new StudentModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(StudentModel::class);
$model = new StudentModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(StudentModel::class);
$model = new StudentModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\SupportRequestModel;
class SupportRequestModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(SupportRequestModel::class);
$this->assertNotNull($record->id);
$fetched = (new SupportRequestModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(SupportRequestModel::class);
$model = new SupportRequestModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(SupportRequestModel::class);
$model = new SupportRequestModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\TeacherClassModel;
class TeacherClassModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(TeacherClassModel::class);
$this->assertNotNull($record->id);
$fetched = (new TeacherClassModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(TeacherClassModel::class);
$model = new TeacherClassModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(TeacherClassModel::class);
$model = new TeacherClassModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\TeacherModel;
class TeacherModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(TeacherModel::class);
$this->assertNotNull($record->id);
$fetched = (new TeacherModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(TeacherModel::class);
$model = new TeacherModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(TeacherModel::class);
$model = new TeacherModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\UserModel;
class UserModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(UserModel::class);
$this->assertNotNull($record->id);
$fetched = (new UserModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(UserModel::class);
$model = new UserModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(UserModel::class);
$model = new UserModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\UserNotificationModel;
class UserNotificationModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(UserNotificationModel::class);
$this->assertNotNull($record->id);
$fetched = (new UserNotificationModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(UserNotificationModel::class);
$model = new UserNotificationModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(UserNotificationModel::class);
$model = new UserNotificationModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace Tests\App\Models;
use Tests\Support\DBReset;
use CodeIgniter\Test\CIUnitTestCase;
use App\Models\UserRoleModel;
class UserRoleModelTest extends CIUnitTestCase
{
protected function setUp(): void
{
parent::setUp();
DBReset::resetDatabase();
}
public function testCanInsertAndRetrieve()
{
$record = fake(UserRoleModel::class);
$this->assertNotNull($record->id);
$fetched = (new UserRoleModel())->find($record->id);
$this->assertEquals($record->id, $fetched->id);
}
public function testCanUpdate()
{
$record = fake(UserRoleModel::class);
$model = new UserRoleModel();
$model->update($record->id, ['updated_at' => date('Y-m-d H:i:s')]);
$this->assertTrue(true); // simple test to verify no exception thrown
}
public function testCanDelete()
{
$record = fake(UserRoleModel::class);
$model = new UserRoleModel();
$model->delete($record->id);
$this->assertNull($model->find($record->id));
}
}