"All new business logic should have corresponding unit tests."
Description
This PR introduces unit tests for the PropertyBooking class in the app/Http/Livewire directory. The tests cover all public methods of the class, ensuring that the new business logic is thoroughly tested.
The tests are located in a new file tests/Unit/PropertyBookingTest.php. Each public method in the PropertyBooking class has a corresponding test method in the test class. The tests cover both expected behaviors and edge cases, including validation rules, booking process, and handling of available dates for properties.
Summary of Changes
Created a new test file tests/Unit/PropertyBookingTest.php.
Added tests for the mount, selectDate, bookViewing, and render methods of the PropertyBooking class.
Utilized Laravel's built-in testing functions and facades to simulate user authentication, session management, and database interactions.
These changes ensure that the new business logic in the PropertyBooking class is robustly tested, enhancing the overall quality of the application.
PR Feedback (click)
I created this PR to address this rule:
"All new business logic should have corresponding unit tests."
Description
This PR introduces unit tests for the
PropertyBooking
class in theapp/Http/Livewire
directory. The tests cover all public methods of the class, ensuring that the new business logic is thoroughly tested.The tests are located in a new file
tests/Unit/PropertyBookingTest.php
. Each public method in thePropertyBooking
class has a corresponding test method in the test class. The tests cover both expected behaviors and edge cases, including validation rules, booking process, and handling of available dates for properties.Summary of Changes
tests/Unit/PropertyBookingTest.php
.mount
,selectDate
,bookViewing
, andrender
methods of thePropertyBooking
class.These changes ensure that the new business logic in the
PropertyBooking
class is robustly tested, enhancing the overall quality of the application.