Skip to content

Commit

Permalink
fix bugs for ValidJalaliDate
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Jun 8, 2024
1 parent 61a3618 commit 1b7066c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":{"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJalaliDateTest::jalali_date_is_correct":8,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJalaliDateTest::jalali_date_is_correct_with_different_default_character":8},"times":{"Milwad\\LaravelValidate\\Tests\\BaseTest::success":0.037,"Milwad\\LaravelValidate\\Tests\\LaravelValidateServiceProviderTest::success":0.001,"Milwad\\LaravelValidate\\Tests\\LaravelValidateServiceProviderTest::all_lang_folders_publish_successfully":0.35,"Milwad\\LaravelValidate\\Tests\\LaravelValidateServiceProviderTest::config_file_publish_successful":0.148,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidBase64Test::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidBase64Test::base64_is_valid":0.014,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidBase64Test::base64_is_not_valid":0.003,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidBitcoinAddressTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidBitcoinAddressTest::bitcoin_address_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidBitcoinAddressTest::bitcoin_address_is_not_valid":0.002,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCamelCaseTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCamelCaseTest::camel_case_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCamelCaseTest::camel_case_is_not_valid":0.002,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCapitalCharWithNumberTest::success":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCapitalCharWithNumberTest::capital_char_with_number_is_valid":0.002,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCapitalCharWithNumberTest::capital_char_with_number_is_not_valid":0.002,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCarNumberTest::success":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCarNumberTest::car_number_is_valid":0.002,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCarNumberTest::car_number_is_not_valid":0.002,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCartNumberIranTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCartNumberIranTest::cart_number_iran_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCreditCardTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCreditCardTest::credit_card_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidCreditCardTest::credit_card_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDiscordUsernameTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDiscordUsernameTest::discord_username_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDiscordUsernameTest::discord_username_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDomainTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDomainTest::domain_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDomainTest::domain_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDuplicateCharacterTest::success":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDuplicateCharacterTest::duplicate_characters_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDuplicateCharacterTest::duplicate_characters_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDuplicateTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDuplicateTest::duplicate_number_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDuplicateTest::duplicate_number_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDuplicateTest::duplicate_string_is_valid":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidDuplicateTest::duplicate_string_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidEvenNumberTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidEvenNumberTest::check_number_is_even":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidEvenNumberTest::check_number_is_not_even":0.002,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidHashtagTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidHashtagTest::text_has_hashtag":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidHashtagTest::text_has_no_hashtag":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidHexColorTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidHexColorTest::text_is_valid_hex_code":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidHexColorTest::text_is_not_valid_hex_code":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidHtmlTagTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidHtmlTagTest::html_tag_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidHtmlTagTest::html_tag_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIbanTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIbanTest::iban_is_valid_without_country":0.008,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIbanTest::iban_is_valid_with_a_country":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIbanTest::iban_is_valid_with_multiple_countries":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIbanTest::iban_is_not_valid_without_country":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIbanTest::iban_is_not_valid_with_a_country":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIbanTest::iban_is_not_valid_with_multiple_countries":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidImeiTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidImeiTest::imei_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidImeiTest::imei_is_not_valid":0.002,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIpAddressIPV4Test::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIpAddressIPV4Test::ipv4_address_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIpAddressIPV4Test::ipv4_address_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIpAddressIPV6Test::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIpAddressIPV6Test::ipv6_address_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIpAddressIPV6Test::ipv6_address_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIranPostalCodeTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIranPostalCodeTest::postal_code_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidIranPostalCodeTest::postal_code_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJalaliDateTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJalaliDateTest::jalali_date_is_correct":0.002,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJalaliDateTest::jalali_date_is_not_correct":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJalaliDateTest::jalali_date_is_not_string":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJalaliDateTest::jalali_date_is_correct_with_different_default_character":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJalaliDateTest::jalali_date_is_not_correct_with_different_default_character":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJwtTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJwtTest::jwt_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidJwtTest::jwt_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidKebabCaseTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidKebabCaseTest::kebab_case_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidKebabCaseTest::kebab_case_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidNameDaysWeekTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidNameDaysWeekTest::name_day_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidNameDaysWeekTest::name_day_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidNationalCardTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidNationalCardTest::national_code_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidNationalCardTest::national_code_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidOddNumberTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidOddNumberTest::number_is_odd":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidOddNumberTest::number_is_not_odd":0.002,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPascalCaseTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPascalCaseTest::pascal_case_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPascalCaseTest::pascal_case_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPatternTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPatternTest::pattern_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPatternTest::pattern_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPhoneNumberTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPhoneNumberTest::phone_number_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPhoneNumberTest::phone_number_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPhoneNumberTest::all_phone_number_is_valid_by_specific_code":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPhoneNumberTest::if_phone_number_validate_method_is_not_exists":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPortTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPortTest::port_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidPortTest::port_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidSlashEndOfStringTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidSlashEndOfStringTest::slash_end_of_string_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidSlashEndOfStringTest::slash_end_of_string_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidSlugTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidSlugTest::slug_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidSlugTest::slug_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidSnakeCaseTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidSnakeCaseTest::snake_case_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidSnakeCaseTest::snake_case_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidStrongPasswordTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidStrongPasswordTest::password_is_strong":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidStrongPasswordTest::password_is_not_strong":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUlidTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUlidTest::ulid_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUlidTest::ulid_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUrlTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUrlTest::url_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUrlTest::url_is_nor_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUsernameTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUsernameTest::username_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUsernameTest::username_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUuidTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUuidTest::uuid_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidUuidTest::uuid_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidVatIdTest::success":0,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidVatIdTest::vatid_is_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidVatIdTest::vatid_is_not_valid":0.001,"Milwad\\LaravelValidate\\Tests\\Rules\\ValidVatIdTest::vat_is_to_long_valid":0.001}}
2 changes: 1 addition & 1 deletion src/Rules/ValidJalaliDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function checkValidDate(int $year, int $month, int $day): bool
{
return ($year >= -61 && $year <= 3177)
&& ($month >= 1 && $month <= 12)
&& $day >= 1 && $day <= $this->jalaliMonthLength($year, $month, $year);
&& $day >= 1 && $day <= $this->jalaliMonthLength($year, $month, $day);
}

/**
Expand Down

0 comments on commit 1b7066c

Please sign in to comment.