Skip to content

Commit

Permalink
Update test scripts for improved coverage and precision settings.
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Dec 28, 2024
1 parent 2b13403 commit 5542761
Show file tree
Hide file tree
Showing 53 changed files with 3,693 additions and 926 deletions.
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
}
],
"require": {
"tastyigniter/core": "^v4.0@beta",
"tastyigniter/ti-ext-automation": "^v4.0@beta",
"tastyigniter/ti-ext-cart": "^v4.0@beta",
"tastyigniter/ti-ext-reservation": "^v4.0@beta"
"tastyigniter/core": "^v4.0@beta || ^v4.0@dev",
"tastyigniter/ti-ext-automation": "^v4.0@beta || ^v4.0@dev",
"tastyigniter/ti-ext-cart": "^v4.0@beta || ^v4.0@dev",
"tastyigniter/ti-ext-reservation": "^v4.0@beta || ^v4.0@dev"
},
"require-dev": {
"laravel/pint": "^1.2",
"larastan/larastan": "^2.4.0",
"sampoyigi/testbench": "dev-main as 1.0",
"pestphp/pest-plugin-laravel": "^2.0",
"pestphp/pest-plugin-laravel": "^3.0",
"igniterlabs/ti-ext-importexport": "v4.x-dev as 4.0"
},
"autoload": {
Expand All @@ -45,7 +45,7 @@
}
},
"scripts": {
"test": "vendor/bin/pest",
"test": "vendor/bin/pest --coverage --exactly=100",
"test-coverage": "vendor/bin/pest --coverage",
"format": "vendor/bin/pint",
"static": "vendor/bin/phpstan analyse --ansi --memory-limit 1056M"
Expand All @@ -58,5 +58,5 @@
},
"sort-packages": true
},
"minimum-stability": "beta"
"minimum-stability": "dev"
}
80 changes: 40 additions & 40 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -56,79 +56,79 @@ parameters:
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:getSettings\\(\\)\\.$#"
count: 1
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:getKey\\(\\)\\.$#"
count: 3
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:listDeliveryAreas\\(\\)\\.$#"
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:getSettings\\(\\)\\.$#"
count: 1
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:searchOrDefaultDeliveryArea\\(\\)\\.$#"
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:getSlugKeyName\\(\\)\\.$#"
count: 1
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:shouldAddLeadTime\\(\\)\\.$#"
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:listDeliveryAreas\\(\\)\\.$#"
count: 1
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:getKey\\(\\)\\.$#"
count: 3
path: src/Classes/Manager.php
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:newQuery\\(\\)\\.$#"
count: 1
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:getSlugKeyName\\(\\)\\.$#"
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:newWorkingSchedule\\(\\)\\.$#"
count: 1
path: src/Classes/Manager.php
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:newQuery\\(\\)\\.$#"
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:searchOrDefaultDeliveryArea\\(\\)\\.$#"
count: 1
path: src/Classes/Manager.php
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:newWorkingSchedule\\(\\)\\.$#"
message: "#^Call to an undefined method Igniter\\\\Local\\\\Contracts\\\\LocationInterface\\:\\:shouldAddLeadTime\\(\\)\\.$#"
count: 1
path: src/Classes/Manager.php
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Builder\\:\\:IsEnabled\\(\\)\\.$#"
count: 1
path: src/Classes/Manager.php
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:selectDistance\\(\\)\\.$#"
count: 1
path: src/Classes/Manager.php
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Query\\\\Builder\\:\\:whereIsEnabled\\(\\)\\.$#"
count: 1
path: src/Classes/Manager.php
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Illuminate\\\\Support\\\\Optional\\:\\:hasPermission\\(\\)\\.$#"
count: 1
path: src/Classes/Manager.php
path: src/Classes/Location.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:getUser\\(\\)\\.$#"
count: 1
path: src/Classes/Manager.php
path: src/Classes/Location.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:isSuperUser\\(\\)\\.$#"
count: 1
path: src/Classes/Manager.php
path: src/Classes/Location.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:user\\(\\)\\.$#"
count: 1
path: src/Classes/Manager.php
path: src/Classes/Location.php

-
message: "#^Call to an undefined method Illuminate\\\\Database\\\\Eloquent\\\\Model\\:\\:getWeekDaysOptions\\(\\)\\.$#"
Expand Down Expand Up @@ -200,6 +200,11 @@ parameters:
count: 1
path: src/Extension.php

-
message: "#^Call to an undefined static method Igniter\\\\Flame\\\\Support\\\\Facades\\\\Igniter\\:\\:runningInAdmin\\(\\)\\.$#"
count: 2
path: src/Extension.php

-
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Facades\\\\Location\\:\\:updateNearbyArea\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -286,17 +291,22 @@ parameters:
path: src/Http/Controllers/Reviews.php

-
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Facades\\\\Location\\:\\:current\\(\\)\\.$#"
message: "#^Call to an undefined static method Igniter\\\\Flame\\\\Support\\\\Facades\\\\Igniter\\:\\:hasDatabase\\(\\)\\.$#"
count: 1
path: src/Http/Middleware/CheckLocation.php

-
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Facades\\\\Location\\:\\:currentOrDefault\\(\\)\\.$#"
message: "#^Call to an undefined static method Igniter\\\\Flame\\\\Support\\\\Facades\\\\Igniter\\:\\:runningInAdmin\\(\\)\\.$#"
count: 2
path: src/Http/Middleware/CheckLocation.php

-
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Facades\\\\Location\\:\\:current\\(\\)\\.$#"
count: 1
path: src/Http/Middleware/CheckLocation.php

-
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Facades\\\\Location\\:\\:resetSession\\(\\)\\.$#"
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Facades\\\\Location\\:\\:currentOrDefault\\(\\)\\.$#"
count: 1
path: src/Http/Middleware/CheckLocation.php

Expand Down Expand Up @@ -470,11 +480,6 @@ parameters:
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$options\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\Location\\:\\:\\$permalink_slug\\.$#"
count: 1
Expand Down Expand Up @@ -545,11 +550,6 @@ parameters:
count: 1
path: src/Models/Location.php

-
message: "#^Method Igniter\\\\Local\\\\Models\\\\Location\\:\\:getCurrentTime\\(\\) should return Carbon\\\\Carbon but return statement is missing\\.$#"
count: 1
path: src/Models/Location.php

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\LocationArea\\:\\:\\$boundaries\\.$#"
count: 1
Expand All @@ -562,7 +562,7 @@ parameters:

-
message: "#^Access to an undefined property Igniter\\\\Local\\\\Models\\\\LocationArea\\:\\:\\$location_id\\.$#"
count: 1
count: 2
path: src/Models/LocationArea.php

-
Expand Down Expand Up @@ -665,6 +665,11 @@ parameters:
count: 1
path: src/Models/Review.php

-
message: "#^Call to an undefined static method Igniter\\\\Flame\\\\Support\\\\Facades\\\\Igniter\\:\\:runningInAdmin\\(\\)\\.$#"
count: 1
path: src/Models/Review.php

-
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Models\\\\Review\\:\\:whereReviewable\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -745,11 +750,6 @@ parameters:
count: 1
path: src/Models/WorkingHour.php

-
message: "#^Call to an undefined static method Igniter\\\\Local\\\\Models\\\\WorkingHour\\:\\:where\\(\\)\\.$#"
count: 1
path: src/Models/WorkingHour.php

-
message: "#^Method Carbon\\\\Carbon\\:\\:addDay\\(\\) invoked with 1 parameter, 0 required\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion src/AutomationRules/Conditions/ReviewCount.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function defineModelAttributes()
public function getReviewCountAttribute($value, $object)
{
if (!$object instanceof Order && !$object instanceof Reservation) {
return false;
return 0;
}

return Review::query()->where([
Expand Down
Loading

0 comments on commit 5542761

Please sign in to comment.