2026-03-09 07:00:12 +07:00
|
|
|
# CLQMS Suggested Commands
|
|
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
## Testing
|
2026-03-09 07:00:12 +07:00
|
|
|
```bash
|
|
|
|
|
# Run all tests
|
2026-03-10 16:40:37 +07:00
|
|
|
./vendor/bin/phpunit
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Run specific test file
|
|
|
|
|
./vendor/bin/phpunit tests/feature/Patients/PatientCreateTest.php
|
2026-03-09 07:00:12 +07:00
|
|
|
|
|
|
|
|
# Run specific test method
|
2026-03-10 16:40:37 +07:00
|
|
|
./vendor/bin/phpunit --filter testCreatePatientSuccess tests/feature/Patients/PatientCreateTest.php
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Run tests with coverage
|
|
|
|
|
./vendor/bin/phpunit --coverage-html build/logs/html
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Run tests by suite
|
|
|
|
|
./vendor/bin/phpunit --testsuite App
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Run via composer
|
|
|
|
|
composer test
|
2026-03-09 07:00:12 +07:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Development Server
|
|
|
|
|
```bash
|
2026-03-10 16:40:37 +07:00
|
|
|
# Start PHP development server
|
2026-03-09 07:00:12 +07:00
|
|
|
php spark serve
|
|
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Or specify port
|
|
|
|
|
php spark serve --port 8080
|
2026-03-09 07:00:12 +07:00
|
|
|
```
|
|
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
## Database
|
2026-03-09 07:00:12 +07:00
|
|
|
```bash
|
2026-03-10 16:40:37 +07:00
|
|
|
# Run migrations
|
|
|
|
|
php spark migrate
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Rollback migrations
|
|
|
|
|
php spark migrate:rollback
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Create new migration
|
|
|
|
|
php spark make:migration CreateUsersTable
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Run database seeds
|
|
|
|
|
php spark db:seed DBSeeder
|
|
|
|
|
php spark db:seed PatientSeeder
|
2026-03-09 07:00:12 +07:00
|
|
|
```
|
|
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
## Code Generation (Scaffolding)
|
2026-03-09 07:00:12 +07:00
|
|
|
```bash
|
2026-03-10 16:40:37 +07:00
|
|
|
# Create controller
|
|
|
|
|
php spark make:controller Users
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Create model
|
|
|
|
|
php spark make:model UserModel
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Create migration
|
|
|
|
|
php spark make:migration CreateUsersTable
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Create seeder
|
|
|
|
|
php spark make:seeder UserSeeder
|
2026-03-09 07:00:12 +07:00
|
|
|
```
|
|
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
## API Documentation
|
2026-03-09 07:00:12 +07:00
|
|
|
```bash
|
2026-03-10 16:40:37 +07:00
|
|
|
# After updating YAML files, regenerate bundled docs
|
|
|
|
|
node public/bundle-api-docs.js
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Produces: public/api-docs.bundled.yaml
|
2026-03-09 07:00:12 +07:00
|
|
|
```
|
|
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
## Utilities (Windows)
|
2026-03-09 07:00:12 +07:00
|
|
|
```bash
|
2026-03-10 16:40:37 +07:00
|
|
|
# List files
|
2026-03-09 07:00:12 +07:00
|
|
|
dir
|
|
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Search in files (PowerShell)
|
|
|
|
|
Select-String -Path "app\*.php" -Pattern "PatientModel"
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Or using git bash (if available)
|
|
|
|
|
grep -r "PatientModel" app/
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Clear writable cache
|
|
|
|
|
del /q writable\cache\*
|
2026-03-09 07:00:12 +07:00
|
|
|
```
|
|
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
## Git Commands
|
2026-03-09 07:00:12 +07:00
|
|
|
```bash
|
2026-03-10 16:40:37 +07:00
|
|
|
# Check status
|
2026-03-09 07:00:12 +07:00
|
|
|
git status
|
|
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Add files
|
2026-03-09 07:00:12 +07:00
|
|
|
git add .
|
|
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# Commit (only when explicitly asked)
|
|
|
|
|
git commit -m "message"
|
2026-03-09 07:00:12 +07:00
|
|
|
|
2026-03-10 16:40:37 +07:00
|
|
|
# View recent commits
|
|
|
|
|
git log --oneline -10
|
2026-03-09 07:00:12 +07:00
|
|
|
```
|