Skip to content

Commit 03519bc

Browse files
committed
styling #98
1 parent 36f4371 commit 03519bc

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

tests/Casts/CurrencyCastTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
class CurrencyCastTest extends TestCase
1212
{
1313
protected Model $model;
14-
protected function setUp():void
14+
15+
protected function setUp(): void
1516
{
16-
$this->model = $model = $this->getMockBuilder(Model::class)->disableOriginalConstructor()->getMock();
17+
$this->model = $this->getMockBuilder(Model::class)->disableOriginalConstructor()->getMock();
1718
}
19+
1820
public function testItWillNotGetCurrencyFromNonStrings()
1921
{
2022
$this->expectException(UnexpectedValueException::class);
@@ -26,21 +28,18 @@ public function testItWillNotSetCurrencyFromNonCurrencies()
2628
{
2729
$this->expectException(UnexpectedValueException::class);
2830

29-
3031
(new CurrencyCast)->set($this->model, 'currency', 'USD', []);
3132
}
3233

3334
public function testItGetsCurrencyFromString()
3435
{
35-
3636
$value = (new CurrencyCast)->get($this->model, 'currency', 'USD', []);
3737

3838
$this->assertEquals(Currency::USD(), $value);
3939
}
4040

4141
public function testItSetsCurrencyAsString()
4242
{
43-
4443
$value = (new CurrencyCast)->set($this->model, 'currency', Currency::USD(), []);
4544

4645
$this->assertSame('USD', $value);

tests/Casts/MoneyCastTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,30 @@
1212
class MoneyCastTest extends TestCase
1313
{
1414
protected Model $model;
15-
protected function setUp():void
15+
16+
protected function setUp(): void
1617
{
17-
$this->model = $model = $this->getMockBuilder(Model::class)->disableOriginalConstructor()->getMock();
18+
$this->model = $this->getMockBuilder(Model::class)->disableOriginalConstructor()->getMock();
1819
}
1920

2021
public function testItWillNotGetMoneyFromNonString()
2122
{
2223
$this->expectException(UnexpectedValueException::class);
2324

24-
2525
(new MoneyCast)->get($this->model, 'money', [], []);
2626
}
2727

2828
public function testItWillNotGetMoneyFromNonJson()
2929
{
3030
$this->expectException(UnexpectedValueException::class);
3131

32-
3332
(new MoneyCast)->get($this->model, 'money', 'testing', []);
3433
}
3534

3635
public function testItWillNotGetMoneyFromIllFormedJson()
3736
{
3837
$this->expectException(UnexpectedValueException::class);
3938

40-
4139
(new MoneyCast)->get($this->model, 'money', '{"key":"value"}', []);
4240
}
4341

@@ -57,7 +55,6 @@ public function testItWillNotSetNonMoneyAsJson()
5755
{
5856
$this->expectException(UnexpectedValueException::class);
5957

60-
6158
(new MoneyCast)->set($this->model, 'money', 1000, []);
6259
}
6360

0 commit comments

Comments
 (0)