{"id":22341830,"url":"https://github.com/sherlockboy/laravel-unit-testing","last_synced_at":"2026-05-18T04:03:56.561Z","repository":{"id":190256319,"uuid":"448991795","full_name":"Sherlockboy/laravel-unit-testing","owner":"Sherlockboy","description":"Unit Testing, Exception Handling example in Laravel","archived":false,"fork":false,"pushed_at":"2022-01-19T20:42:02.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T05:29:43.744Z","etag":null,"topics":["exception-handling","laravel","php","php-unit","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sherlockboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-01-17T17:44:15.000Z","updated_at":"2022-01-19T20:13:29.000Z","dependencies_parsed_at":"2023-08-23T21:27:27.369Z","dependency_job_id":null,"html_url":"https://github.com/Sherlockboy/laravel-unit-testing","commit_stats":null,"previous_names":["sherlockboy/laravel-unit-testing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sherlockboy/laravel-unit-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherlockboy%2Flaravel-unit-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherlockboy%2Flaravel-unit-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherlockboy%2Flaravel-unit-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherlockboy%2Flaravel-unit-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sherlockboy","download_url":"https://codeload.github.com/Sherlockboy/laravel-unit-testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherlockboy%2Flaravel-unit-testing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33164672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exception-handling","laravel","php","php-unit","unit-testing"],"created_at":"2024-12-04T08:08:20.219Z","updated_at":"2026-05-18T04:03:56.543Z","avatar_url":"https://github.com/Sherlockboy.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# PHPUnit example\n### Task description\n\nYou have products database:\n\n| Product code | Name         | Price  |\n|--------------|--------------|--------|\n| FR1          | Fruit Tea    | $3.11  |\n| SR1          | Strawberries | $5.00  |\n| CF1          | Coffee       | $11.23 |\n\n1. CEO wants that if you buy at least one tea, next should be free.\n2. CTO wants low prices, so that, if you buy 3 or more strawberries price should drop to $4.50.\n\nYour code should be flexible, because CTO and CEO often changes the rules.\n\nThe service should look like this:\n```\n$ch = new Checkout($pricing_rules);\n$co-\u003escan($item1);\n$co-\u003escan($item2);\n$price = $ch-\u003etotal();\n```\n\nImplement a checkout system that fulfils these requirements.\n\n### Test data\n\nBasket: FR1,SR1,FR1,FR1,CF1  \nTotal price expected: $22.45\n\nBasket: FR1,FR1  \nTotal price expected: $3.11\n\nBasket: SR1,SR1,FR1,SR1  \nTotal price expected: $16.61\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherlockboy%2Flaravel-unit-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsherlockboy%2Flaravel-unit-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherlockboy%2Flaravel-unit-testing/lists"}