System developed as proof of employment opportunity for the IOTEC company.
The solution was developed in PHP and is based on calculating the amount to be paid to an employee depending on the days and hours he has worked.
Employee information will be entered in a .txt file with designated rates, the amount to be paid will be calculated taking into account whether the days worked are weekdays or weekends
To run the system locally you need:
- PHP.
- Composer Descargar Composer
- Clone the project in the xampp htdocs folder.
https://github.com/Jorge1308/Iiotec_prueba_Jorge_Silva.git
- Run the
composer install
command from the console to install the PHP - We put in the browser the address of the folder in which the project is located.
http://localhost/Iiotec_prueba_Jorge_Silva/App/View/
- O se puede ejecutar desde consola en el fichero del proyecto carpeta
App/View/index.php
Due to the simplicity of the solution, an architecture as such cannot be evidenced, but a similarity with the MVC architecture can be established, especially in the order of the files that make up the project.
The index.php file as a view.
The amounToPay.php file as a controller.
The system does not require a database so the information is obtained in a method of the class of the amounTopay.php file
The dependency used was PHPUnit for system testing, installed through composer.
PHPUnit is an instance of the xUnit architecture for unit testing frameworks.
For its installation the command is executed composer require --dev phpunit/phpunit ^9
And to run the tests the command ./vendor/bin/phpunit ./CalculateMountTest.php ./CalculateMountTest
The following is one of the tests performed on the system
php
/** @test **/ public function check_if_file_exists() { $this->assertFileExists('./App/Datos.txt'); }
It is an object-oriented programming, with static attributes and methods.
During the development of the system, it is intended to solve the problem in a simple but efficient way, validating the information and with due testing.
A simple logic in a way that is easy to understand and at the same time maintains a structure that allows the scalability of the solution