| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/project-slim/tests/ |
Upload File : |
<?php
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/app/bootstrap.php';
use App\Models\User;
use App\Models\Company;
use App\Models\Role;
use App\Models\Module;
try {
echo "๐งช Testing Schema Compatibility\n";
echo "===============================\n\n";
// Test Company model
echo "Testing Company model...\n";
$company = new Company();
echo "โ
Company model instantiated successfully\n";
echo " Primary Key: " . $company->getKeyName() . "\n";
echo " Table: " . $company->getTable() . "\n\n";
// Test User model
echo "Testing User model...\n";
$user = new User();
echo "โ
User model instantiated successfully\n";
echo " Primary Key: " . $user->getKeyName() . "\n";
echo " Table: " . $user->getTable() . "\n\n";
// Test Role model
echo "Testing Role model...\n";
$role = new Role();
echo "โ
Role model instantiated successfully\n";
echo " Primary Key: " . $role->getKeyName() . "\n";
echo " Table: " . $role->getTable() . "\n\n";
// Test Module model
echo "Testing Module model...\n";
$module = new Module();
echo "โ
Module model instantiated successfully\n";
echo " Primary Key: " . $module->getKeyName() . "\n";
echo " Table: " . $module->getTable() . "\n\n";
// Test relationships
echo "Testing relationships...\n";
$userCompanyRelation = $user->company();
echo "โ
User->Company relationship defined\n";
$companyUsersRelation = $company->users();
echo "โ
Company->Users relationship defined\n";
$userRolesRelation = $user->roles();
echo "โ
User->Roles relationship defined\n\n";
echo "๐ All tests passed! Schema is compatible with your models.\n";
} catch (Exception $e) {
echo "โ Error: " . $e->getMessage() . "\n";
echo " File: " . $e->getFile() . "\n";
echo " Line: " . $e->getLine() . "\n";
}