generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdc24d2
commit 614060a
Showing
29 changed files
with
272 additions
and
593 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":"pest_3.1.0","defects":{"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_return_empty_addresses_collection_when_eloquent_has_no_addresses":8,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_billing_address_primary_unmarked_event_on_make_primary":8,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_return_addresses_collection_when_eloquent_has_addresses":8,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_billing_address_primary_marked_event_on_make_primary":8,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_address_primary_unmarked_event_on_make_primary":8,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_shipping_address_primary_unmarked_event_on_make_primary":8,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_shipping_address_primary_marked_event_on_make_primary":8,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_address_primary_marked_event_on_make_primary":8},"times":{"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_return_addresses_collection_when_eloquent_has_addresses":0.006,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_address_primary_unmarked_event_on_make_primary":0.004,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_shipping_address_primary_unmarked_event_on_make_primary":0.004,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_address_primary_marked_event_on_make_primary":0.044,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_billing_address_primary_marked_event_on_make_primary":0.007,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_billing_address_primary_unmarked_event_on_make_primary":0.005,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_return_empty_addresses_collection_when_eloquent_has_no_addresses":0.019,"P\\Tests\\Feature\\Models\\AddressTest::__pest_evaluable_it_fires_shipping_address_primary_marked_event_on_make_primary":0.004,"P\\Tests\\ArchTest::__pest_evaluable_it_will_not_use_debugging_functions":0.045}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
namespace Masterix21\Addressable\Database\Factories; | ||
|
||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Masterix21\Addressable\Models\Address; | ||
|
||
class AddressFactory extends Factory | ||
{ | ||
protected $model = Address::class; | ||
|
||
public function definition(): array | ||
{ | ||
return [ | ||
'is_primary' => $this->faker->boolean, | ||
'is_billing' => $this->faker->boolean, | ||
'is_shipping' => $this->faker->boolean, | ||
'label' => $this->faker->boolean ? $this->faker->streetName : null, | ||
'street_address1' => $this->faker->streetAddress, | ||
'street_address2' => $this->faker->streetAddress, | ||
'zip' => $this->faker->postcode, | ||
'city' => $this->faker->city, | ||
'state' => $this->faker->state, | ||
'country' => $this->faker->countryCode, | ||
'coordinates' => [$this->faker->latitude, $this->faker->longitude], | ||
]; | ||
} | ||
|
||
public function addressable(Model $model): Factory | ||
{ | ||
return $this->state(function (array $attributes) use ($model) { | ||
return [ | ||
'addressable_type' => $model::class, | ||
'addressable_id' => $model->getKey(), | ||
]; | ||
}); | ||
} | ||
|
||
public function primary(): Factory | ||
{ | ||
return $this->state(function (array $attributes) { | ||
return [ | ||
'is_primary' => true, | ||
]; | ||
}); | ||
} | ||
|
||
public function billing(): Factory | ||
{ | ||
return $this->state(function (array $attributes) { | ||
return [ | ||
'is_billing' => true, | ||
]; | ||
}); | ||
} | ||
|
||
public function shipping(): Factory | ||
{ | ||
return $this->state(function (array $attributes) { | ||
return [ | ||
'is_shipping' => true, | ||
]; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Masterix21\Addressable\Database\Factories; | ||
|
||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use Illuminate\Support\Str; | ||
use Masterix21\Addressable\Tests\TestClasses\User; | ||
|
||
class UserFactory extends Factory | ||
{ | ||
protected $model = User::class; | ||
|
||
public function definition(): array | ||
{ | ||
return [ | ||
'name' => $this->faker->name, | ||
'email' => $this->faker->unique()->safeEmail, | ||
'email_verified_at' => now(), | ||
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password | ||
'remember_token' => Str::random(10), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
includes: | ||
- phpstan-baseline.neon | ||
|
||
parameters: | ||
level: 5 | ||
paths: | ||
- src | ||
- config | ||
- database | ||
tmpDir: build/phpstan | ||
checkOctaneCompatibility: true | ||
checkModelProperties: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="vendor/autoload.php" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
verbose="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false"> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" | ||
backupGlobals="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
executionOrder="random" | ||
failOnWarning="true" | ||
failOnRisky="true" | ||
failOnEmptyTestSuite="true" | ||
beStrictAboutOutputDuringTests="true" | ||
cacheDirectory=".phpunit.cache" | ||
backupStaticProperties="false" | ||
> | ||
<testsuites> | ||
<testsuite name="Masterix21 Test Suite"> | ||
<testsuite name="VendorName Test Suite"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
<logging> | ||
<log type="junit" target="build/report.junit.xml"/> | ||
<log type="coverage-html" target="build/coverage"/> | ||
<log type="coverage-text" target="build/coverage.txt"/> | ||
<log type="coverage-clover" target="build/logs/clover.xml"/> | ||
<junit outputFile="build/report.junit.xml"/> | ||
</logging> | ||
<source> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.