Skip to content

Commit

Permalink
Merge branch '1.x' into 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
glennjacobs authored Nov 19, 2024
2 parents f1ca604 + 7f6ced9 commit 223f719
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/admin/resources/lang/es/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
'label' => 'Cantidad',

'hint' => [
'less_than_total' => "Está a punto de capturar un monto menor al valor total de la transacción",
'less_than_total' => 'Está a punto de capturar un monto menor al valor total de la transacción',
],
],

Expand Down
3 changes: 1 addition & 2 deletions packages/admin/resources/lang/nl/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
'label' => 'Bedrag',

'hint' => [
'less_than_total' => "Je staat op het punt een bedrag te incasseren dat minder is dan de totale transactiewaarde",
'less_than_total' => 'Je staat op het punt een bedrag te incasseren dat minder is dan de totale transactiewaarde',
],
],

Expand Down Expand Up @@ -290,4 +290,3 @@
],

];

1 change: 0 additions & 1 deletion packages/admin/resources/lang/nl/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,3 @@
],
],
];

2 changes: 1 addition & 1 deletion packages/core/src/FieldTypes/Toggle.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function jsonSerialize(): mixed
/**
* Create a new instance of Toggle field type.
*
* @param string $value
* @param bool|string $value
*/
public function __construct($value = false)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
return [
'shipping_methods' => [
'customer_groups' => [
'description' => "Asocia grupos de clientes a este método de envío para determinar su disponibilidad.",
'description' => 'Asocia grupos de clientes a este método de envío para determinar su disponibilidad.',
],
],
'shipping_rates' => [
Expand Down
24 changes: 24 additions & 0 deletions tests/core/Unit/FieldTypes/ToggleFieldTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

uses(\Lunar\Tests\Core\TestCase::class);
use Lunar\Exceptions\FieldTypeException;
use Lunar\FieldTypes\Toggle;

test('can set value', function () {
$field = new Toggle;
$field->setValue(false);

expect($field->getValue())->toEqual(false);
});

test('can set value in constructor', function () {
$field = new Toggle(true);

expect($field->getValue())->toEqual(true);
});

test('check it does not allow array', function () {
$this->expectException(FieldTypeException::class);

new Toggle(['foo']);
});

0 comments on commit 223f719

Please sign in to comment.