Skip to content

Commit

Permalink
test: linting test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
devansh-webkul committed Jul 29, 2024
1 parent 4ac9d28 commit 37110e3
Show file tree
Hide file tree
Showing 49 changed files with 143 additions and 143 deletions.
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ protected function processRequest(): void
'size' => $pagination['per_page'],
'stored_fields' => [],
'query' => [
'bool' => $this->getElasticFilters($params['filters'] ?? []) ?: new \stdClass(),
'bool' => $this->getElasticFilters($params['filters'] ?? []) ?: new \stdClass,
],
'sort' => $this->getElasticSort($params['sort'] ?? []),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function create()
public function store()
{
$this->validate(request(), [
'code' => ['required', 'not_in:type,attribute_family_id', 'unique:attributes,code', new Code()],
'code' => ['required', 'not_in:type,attribute_family_id', 'unique:attributes,code', new Code],
'admin_name' => 'required',
'type' => 'required',
'default_value' => 'integer',
Expand Down
2 changes: 1 addition & 1 deletion packages/Webkul/Admin/src/Http/Requests/AddressRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function rules()
'city' => ['required'],
'postcode' => ['required', 'numeric'],
'phone' => ['required', new PhoneNumber],
'vat_id' => [new VatIdRule()],
'vat_id' => [new VatIdRule],
'email' => ['required'],
'default_address' => ['sometimes', 'required', 'in:0,1'],
];
Expand Down
22 changes: 11 additions & 11 deletions packages/Webkul/Admin/tests/Feature/Catalog/CategoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

it('should show category edit page', function () {
// Arrange.
$category = (new CategoryFaker())->factory()->create();
$category = (new CategoryFaker)->factory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -35,7 +35,7 @@

it('should return listing items of categories', function () {
// Arrange.
$category = (new CategoryFaker())->factory()->create();
$category = (new CategoryFaker)->factory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand Down Expand Up @@ -165,7 +165,7 @@

it('should fail the validation with errors when certain inputs are not provided when update in category', function () {
// Arrange.
$category = (new CategoryFaker())->factory()->create();
$category = (new CategoryFaker)->factory()->create();

$localeCode = core()->getRequestedLocaleCode();

Expand All @@ -182,7 +182,7 @@

it('should fail the validation with errors when certain inputs are not provided and display mode products and description when update in category', function () {
// Arrange.
$category = (new CategoryFaker())->factory()->create();
$category = (new CategoryFaker)->factory()->create();

$localeCode = core()->getRequestedLocaleCode();

Expand All @@ -202,7 +202,7 @@

it('should fails the validation with certain provided inputs', function () {
// Arrange.
$category = (new CategoryFaker())->factory()->create();
$category = (new CategoryFaker)->factory()->create();

$attributes = Attribute::where('is_filterable', 1)->pluck('id')->toArray();

Expand Down Expand Up @@ -232,7 +232,7 @@

it('should update a category', function () {
// Arrange.
$category = (new CategoryFaker())->factory()->create();
$category = (new CategoryFaker)->factory()->create();

$attributes = Attribute::where('is_filterable', 1)->pluck('id')->toArray();

Expand Down Expand Up @@ -271,7 +271,7 @@

it('should delete a category', function () {
// Arrange.
$category = (new CategoryFaker())->factory()->create();
$category = (new CategoryFaker)->factory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -287,7 +287,7 @@

it('should delete mass categories', function () {
// Arrange.
$categories = (new CategoryFaker())->create(5);
$categories = (new CategoryFaker)->create(5);

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -307,7 +307,7 @@

it('should update mass categories', function () {
// Arrange.
$categories = (new CategoryFaker())->create(5);
$categories = (new CategoryFaker)->create(5);

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -333,7 +333,7 @@

it('should search categories with mega search', function () {
// Arrange.
$category = (new CategoryFaker())->factory()->create();
$category = (new CategoryFaker)->factory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -348,7 +348,7 @@

it('should show the tree view of categories', function () {
// Arrange.
$category = (new CategoryFaker())->factory()->create();
$category = (new CategoryFaker)->factory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

it('should copy the existing product', function () {
// Arrange.
$product = (new ProductFaker())->getSimpleProductFactory()->create();
$product = (new ProductFaker)->getSimpleProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -39,7 +39,7 @@

it('should perform the mass action from update status for products', function () {
// Arrange.
$products = (new ProductFaker())->getSimpleProductFactory()->count(2)->create();
$products = (new ProductFaker)->getSimpleProductFactory()->count(2)->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -66,7 +66,7 @@

it('should perform the mass action for delete for products', function () {
// Arrange.
$products = (new ProductFaker())->getSimpleProductFactory()->count(2)->create();
$products = (new ProductFaker)->getSimpleProductFactory()->count(2)->create();

// Act and Assert.
$this->loginAsAdmin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

it('should return the create page of bundle product', function () {
// Arrange.
$product = (new ProductFaker())->getSimpleProductFactory()->create();
$product = (new ProductFaker)->getSimpleProductFactory()->create();

$productId = $product->id + 1;

Expand Down Expand Up @@ -50,7 +50,7 @@

it('should return the edit page of bundle product', function () {
// Arrange.
$product = (new ProductFaker())->getBundleProductFactory()->create();
$product = (new ProductFaker)->getBundleProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -67,7 +67,7 @@

it('should fail the validation with errors when certain inputs are not provided when update in bundle product', function () {
// Arrange.
$product = (new ProductFaker())->getBundleProductFactory()->create();
$product = (new ProductFaker)->getBundleProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -83,7 +83,7 @@

it('should fail the validation with errors if certain data is not provided correctly in bundle product', function () {
// Arrange.
$product = (new ProductFaker())->getBundleProductFactory()->create();
$product = (new ProductFaker)->getBundleProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -110,7 +110,7 @@

it('should update the bundle product', function () {
// Arrange.
$product = (new ProductFaker())->getBundleProductFactory()->create();
$product = (new ProductFaker)->getBundleProductFactory()->create();

$options = [];

Expand Down Expand Up @@ -211,7 +211,7 @@

it('should delete a bundle product', function () {
// Arrange.
$product = (new ProductFaker())->getBundleProductFactory()->create();
$product = (new ProductFaker)->getBundleProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

it('should return the edit page of configurable product', function () {
// Arrange.
$product = (new ProductFaker())->getConfigurableProductFactory()->create();
$product = (new ProductFaker)->getConfigurableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -67,7 +67,7 @@

it('should fail the validation with errors when certain inputs are not provided when update in configurable product', function () {
// Arrange.
$product = (new ProductFaker())->getConfigurableProductFactory()->create();
$product = (new ProductFaker)->getConfigurableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -83,7 +83,7 @@

it('should fail the validation with errors if certain data is not provided correctly in configurable product', function () {
// Arrange.
$product = (new ProductFaker())->getConfigurableProductFactory()->create();
$product = (new ProductFaker)->getConfigurableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -110,7 +110,7 @@

it('should update the configurable product', function () {
// Arrange.
$product = (new ProductFaker())->getConfigurableProductFactory()->create();
$product = (new ProductFaker)->getConfigurableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand Down Expand Up @@ -158,7 +158,7 @@

it('should update the configurable product variants', function () {
// Arrange.
$product = (new ProductFaker())->getConfigurableProductFactory()->create();
$product = (new ProductFaker)->getConfigurableProductFactory()->create();

$attributeOptions = AttributeFamily::find(1)->configurable_attributes
->flatMap(function ($attribute) {
Expand Down Expand Up @@ -222,7 +222,7 @@

it('should delete a configurable product', function () {
// Arrange.
$product = (new ProductFaker())->getConfigurableProductFactory()->create();
$product = (new ProductFaker)->getConfigurableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

it('should return the create page of downloadable product', function () {
// Arrange.
$product = (new ProductFaker())->getSimpleProductFactory()->create();
$product = (new ProductFaker)->getSimpleProductFactory()->create();

$productId = $product->id + 1;

Expand Down Expand Up @@ -69,7 +69,7 @@

it('should return the edit page of downloadable product', function () {
// Arrange.
$product = (new ProductFaker())->getDownloadableProductFactory()->create();
$product = (new ProductFaker)->getDownloadableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -86,7 +86,7 @@

it('should upload link the product upload link', function () {
// Arrange.
$product = (new ProductFaker())->getDownloadableProductFactory()->create();
$product = (new ProductFaker)->getDownloadableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -104,7 +104,7 @@

it('should fail the validation with errors when certain inputs are not provided when update in downloadable product', function () {
// Arrange.
$product = (new ProductFaker())->getDownloadableProductFactory()->create();
$product = (new ProductFaker)->getDownloadableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand All @@ -121,7 +121,7 @@

it('should fail the validation with errors if certain data is not provided correctly in downloadable product', function () {
// Arrange.
$product = (new ProductFaker())->getDownloadableProductFactory()->create();
$product = (new ProductFaker)->getDownloadableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand Down Expand Up @@ -149,7 +149,7 @@

it('should upload the sample file', function () {
// Arrange.
$product = (new ProductFaker())->getDownloadableProductFactory()->create();
$product = (new ProductFaker)->getDownloadableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand Down Expand Up @@ -312,7 +312,7 @@

it('should delete a downloadable product', function () {
// Arrange.
$product = (new ProductFaker())->getDownloadableProductFactory()->create();
$product = (new ProductFaker)->getDownloadableProductFactory()->create();

// Act and Assert.
$this->loginAsAdmin();
Expand Down
Loading

0 comments on commit 37110e3

Please sign in to comment.