Skip to content

Commit af5af77

Browse files
committed
fix: fix pint errors
1 parent 46b080e commit af5af77

File tree

11 files changed

+70
-70
lines changed

11 files changed

+70
-70
lines changed

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class TestCase extends BaseTestCase
1111
/**
1212
* {@inheritDoc}
1313
*/
14-
public function setUp(): void
14+
protected function setUp(): void
1515
{
1616
parent::setUp();
1717

tests/Unit/Model/CustomerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class CustomerTest extends TestCase
1212
{
13-
public function testOrderCountProperty(): void
13+
public function test_order_count_property(): void
1414
{
1515
$customer = $this->createCustomer();
1616
$customer->createMeta([
@@ -20,14 +20,14 @@ public function testOrderCountProperty(): void
2020
$this->assertSame(10, $customer->order_count);
2121
}
2222

23-
public function testArrayHasAppendedValues(): void
23+
public function test_array_has_appended_values(): void
2424
{
2525
$customer = $this->createCustomer();
2626

2727
$this->assertArrayHasKey('order_count', $customer->toArray());
2828
}
2929

30-
public function testRelatedOrders(): void
30+
public function test_related_orders(): void
3131
{
3232
$customer = $this->createCustomer();
3333

tests/Unit/Model/ItemTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,55 +11,55 @@
1111

1212
class ItemTest extends TestCase
1313
{
14-
public function testLineSubtotalProperty(): void
14+
public function test_line_subtotal_property(): void
1515
{
1616
$item = $this->createItem();
1717
$item->createMeta('_line_subtotal', '9.99');
1818

1919
$this->assertSame('9.99', $item->line_subtotal);
2020
}
2121

22-
public function testLineSubtotalTaxProperty(): void
22+
public function test_line_subtotal_tax_property(): void
2323
{
2424
$item = $this->createItem();
2525
$item->createMeta('_line_subtotal_tax', '8.88');
2626

2727
$this->assertSame('8.88', $item->line_subtotal_tax);
2828
}
2929

30-
public function testLineTaxProperty(): void
30+
public function test_line_tax_property(): void
3131
{
3232
$item = $this->createItem();
3333
$item->createMeta('_line_tax', '7.77');
3434

3535
$this->assertSame('7.77', $item->line_tax);
3636
}
3737

38-
public function testLineTotalProperty(): void
38+
public function test_line_total_property(): void
3939
{
4040
$item = $this->createItem();
4141
$item->createMeta('_line_total', '6.66');
4242

4343
$this->assertSame('6.66', $item->line_total);
4444
}
4545

46-
public function testQuantityProperty(): void
46+
public function test_quantity_property(): void
4747
{
4848
$item = $this->createItem();
4949
$item->createMeta('_qty', '5');
5050

5151
$this->assertSame('5', $item->quantity);
5252
}
5353

54-
public function testTaxClassProperty(): void
54+
public function test_tax_class_property(): void
5555
{
5656
$item = $this->createItem();
5757
$item->createMeta('_tax_class', 'standard');
5858

5959
$this->assertSame('standard', $item->tax_class);
6060
}
6161

62-
public function testRelatedOrder(): void
62+
public function test_related_order(): void
6363
{
6464
/** @var Order */
6565
$order = Order::factory()->create();
@@ -68,7 +68,7 @@ public function testRelatedOrder(): void
6868
$this->assertTrue($item->order->is($order));
6969
}
7070

71-
public function testRelatedProduct(): void
71+
public function test_related_product(): void
7272
{
7373
/** @var \Corcel\WooCommerce\Model\Product */
7474
$product = Product::factory()->create();
@@ -80,7 +80,7 @@ public function testRelatedProduct(): void
8080
}
8181

8282
/**
83-
* @param mixed[] $attributes
83+
* @param array<string, mixed> $attributes
8484
*/
8585
private function createItem(array $attributes = []): Item
8686
{

tests/Unit/Model/OrderTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,47 @@
1515

1616
class OrderTest extends TestCase
1717
{
18-
public function testCurrencyProperty(): void
18+
public function test_currency_property(): void
1919
{
2020
$order = $this->createOrder();
2121
$order->createMeta('_order_currency', 'USD');
2222

2323
$this->assertSame('USD', $order->currency);
2424
}
2525

26-
public function testTotalProperty(): void
26+
public function test_total_property(): void
2727
{
2828
$order = $this->createOrder();
2929
$order->createMeta('_order_total', '9.99');
3030

3131
$this->assertSame('9.99', $order->total);
3232
}
3333

34-
public function testShippingProperty(): void
34+
public function test_shipping_property(): void
3535
{
3636
$order = $this->createOrder();
3737
$order->createMeta('_order_shipping', '8.88');
3838

3939
$this->assertSame('8.88', $order->shipping);
4040
}
4141

42-
public function testTaxProperty(): void
42+
public function test_tax_property(): void
4343
{
4444
$order = $this->createOrder();
4545
$order->createMeta('_order_tax', '7.77');
4646

4747
$this->assertSame('7.77', $order->tax);
4848
}
4949

50-
public function testShippingTaxProperty(): void
50+
public function test_shipping_tax_property(): void
5151
{
5252
$order = $this->createOrder();
5353
$order->createMeta('_order_shipping_tax', '6.66');
5454

5555
$this->assertSame('6.66', $order->shipping_tax);
5656
}
5757

58-
public function testStatusProperty(): void
58+
public function test_status_property(): void
5959
{
6060
$order = $this->createOrder([
6161
'post_status' => 'wc-refunded',
@@ -64,7 +64,7 @@ public function testStatusProperty(): void
6464
$this->assertSame('refunded', $order->status);
6565
}
6666

67-
public function testDateCompletedProperty(): void
67+
public function test_date_completed_property(): void
6868
{
6969
$order = $this->createOrder();
7070
$order->createMeta('_date_completed', 1577836800); // '2020-01-01 00:00:00'
@@ -73,7 +73,7 @@ public function testDateCompletedProperty(): void
7373
$this->assertSame('2020-01-01 00:00:00', $order->date_completed->format('Y-m-d H:i:s'));
7474
}
7575

76-
public function testDatePaidProperty(): void
76+
public function test_date_paid_property(): void
7777
{
7878
$order = $this->createOrder();
7979
$order->createMeta('_date_paid', 1577840400); // '2020-01-01 01:00:00'
@@ -82,7 +82,7 @@ public function testDatePaidProperty(): void
8282
$this->assertSame('2020-01-01 01:00:00', $order->date_paid->format('Y-m-d H:i:s'));
8383
}
8484

85-
public function testDeprecatedDateFormats(): void
85+
public function test_deprecated_date_formats(): void
8686
{
8787
$order = $this->createOrder();
8888
$order->createMeta('_completed_date', '2020-01-01 00:00:00');
@@ -95,28 +95,28 @@ public function testDeprecatedDateFormats(): void
9595
$this->assertSame('2020-01-01 01:00:00', $order->date_paid->format('Y-m-d H:i:s'));
9696
}
9797

98-
public function testPaymentProperty(): void
98+
public function test_payment_property(): void
9999
{
100100
$order = $this->createOrder();
101101

102102
$this->assertInstanceOf(Payment::class, $order->payment);
103103
}
104104

105-
public function testBillingAddressProperty(): void
105+
public function test_billing_address_property(): void
106106
{
107107
$order = $this->createOrder();
108108

109109
$this->assertInstanceOf(BillingAddress::class, $order->billing_address);
110110
}
111111

112-
public function testShippingAddressProperty(): void
112+
public function test_shipping_address_property(): void
113113
{
114114
$order = $this->createOrder();
115115

116116
$this->assertInstanceOf(ShippingAddress::class, $order->shipping_address);
117117
}
118118

119-
public function testArrayHasAppendedValues(): void
119+
public function test_array_has_appended_values(): void
120120
{
121121
/** @var Order */
122122
$order = Order::factory()->create();
@@ -135,7 +135,7 @@ public function testArrayHasAppendedValues(): void
135135
$this->assertArrayHasKey('shipping_address', $array);
136136
}
137137

138-
public function testRelatedCustomer(): void
138+
public function test_related_customer(): void
139139
{
140140
/** @var Customer */
141141
$customer = Customer::factory()->create();
@@ -149,14 +149,14 @@ public function testRelatedCustomer(): void
149149
$this->assertTrue($orderCustomer->is($customer));
150150
}
151151

152-
public function testGuestOrder(): void
152+
public function test_guest_order(): void
153153
{
154154
$order = $this->createOrder();
155155

156156
$this->assertNull($order->customer);
157157
}
158158

159-
public function testRelatedItems(): void
159+
public function test_related_items(): void
160160
{
161161
$order = $this->createOrder();
162162

@@ -166,7 +166,7 @@ public function testRelatedItems(): void
166166
}
167167

168168
/**
169-
* @param mixed[] $attributes
169+
* @param array<string, mixed> $attributes
170170
*/
171171
private function createOrder(array $attributes = []): Order
172172
{

tests/Unit/Model/ProductAttributeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
class ProductAttributeTest extends TestCase
1212
{
13-
public function testTermsProperty(): void
13+
public function test_terms_property(): void
1414
{
15-
$productAttribute = new ProductAttribute();
16-
$productAttribute->setTerms(new Collection());
15+
$productAttribute = new ProductAttribute;
16+
$productAttribute->setTerms(new Collection);
1717

1818
$this->assertInstanceOf(Collection::class, $productAttribute->terms);
1919
}

0 commit comments

Comments
 (0)