- Introduced a new `TasksController` to handle work time logic, moving it from the factory layer to the domain layer. - Created `WorkTimeRepository` to encapsulate data access for work time tasks, including methods to retrieve clients with unsettled tasks and calculate task times. - Updated the work time view to display a consolidated billing summary with improved UI elements and AJAX functionality for closing tasks. - Added new styles for the billing summary section in `style.scss`. - Implemented tests for the `TasksController` and `WorkTimeRepository` to ensure functionality and correctness. - Established a refactoring plan for future improvements and migrations within the CRM system.
34 lines
521 B
PHP
34 lines
521 B
PHP
<?php
|
|
|
|
require_once __DIR__ . '/Domain/Tasks/WorkTimeRepositoryTest.php';
|
|
require_once __DIR__ . '/Controllers/TasksControllerTest.php';
|
|
|
|
$tests = [
|
|
'run_work_time_repository_tests',
|
|
'run_tasks_controller_tests'
|
|
];
|
|
|
|
$failed = 0;
|
|
|
|
foreach ( $tests as $test )
|
|
{
|
|
try
|
|
{
|
|
$test();
|
|
echo "[OK] {$test}\n";
|
|
}
|
|
catch ( Throwable $e )
|
|
{
|
|
$failed++;
|
|
echo "[FAIL] {$test}: " . $e -> getMessage() . "\n";
|
|
}
|
|
}
|
|
|
|
if ( $failed )
|
|
{
|
|
echo "\nFailed: {$failed}\n";
|
|
exit( 1 );
|
|
}
|
|
|
|
echo "\nAll tests passed.\n";
|