Skip to content

Commit a448a2b

Browse files
authored
Merge pull request #4 from tiny-blocks/release/1.0.1
Release/1.0.1
2 parents 6a73373 + 52fa150 commit a448a2b

5 files changed

Lines changed: 24 additions & 20 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Tiny Blocks
3+
Copyright (c) 2022-2023 Tiny Blocks
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/ValueObjectAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ trait ValueObjectAdapter
1010
{
1111
public function values(): array
1212
{
13-
return get_object_vars($this);
13+
return get_object_vars(object: $this);
1414
}
1515

1616
public function equals(ValueObject $other): bool

tests/ComplexValueTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function testWhenEqualIsFalse(): void
7474
public function testInvalidProperty(): void
7575
{
7676
$this->expectException(InvalidProperty::class);
77-
$this->expectErrorMessage('Invalid property <other> for class <TinyBlocks\Vo\Mock\ComplexValueMock>.');
77+
$this->expectExceptionMessage('Invalid property <other> for class <TinyBlocks\Vo\Mock\ComplexValueMock>.');
7878

7979
$complex = new ComplexValueMock(
8080
single: new SingleValueMock(id: 1000),
@@ -86,13 +86,15 @@ public function testInvalidProperty(): void
8686
]
8787
)
8888
);
89-
$complex->__get('other');
89+
$complex->__get(key: 'other');
9090
}
9191

9292
public function testPropertyCannotBeChanged(): void
9393
{
9494
$this->expectException(PropertyCannotBeChanged::class);
95-
$this->expectErrorMessage('Property <other> cannot be changed in class <TinyBlocks\Vo\Mock\ComplexValueMock>.');
95+
$this->expectExceptionMessage(
96+
'Property <other> cannot be changed in class <TinyBlocks\Vo\Mock\ComplexValueMock>.'
97+
);
9698

9799
$complex = new ComplexValueMock(
98100
single: new SingleValueMock(id: 1000),
@@ -104,13 +106,13 @@ public function testPropertyCannotBeChanged(): void
104106
]
105107
)
106108
);
107-
$complex->__set('other', new StdClass());
109+
$complex->__set(key: 'other', value: new StdClass());
108110
}
109111

110112
public function testPropertyCannotBeDeactivated(): void
111113
{
112114
$this->expectException(PropertyCannotBeDeactivated::class);
113-
$this->expectErrorMessage(
115+
$this->expectExceptionMessage(
114116
'Property <other> cannot be deactivated in class <TinyBlocks\Vo\Mock\ComplexValueMock>.'
115117
);
116118

@@ -124,6 +126,6 @@ public function testPropertyCannotBeDeactivated(): void
124126
]
125127
)
126128
);
127-
$complex->__unset('other');
129+
$complex->__unset(key: 'other');
128130
}
129131
}

tests/MultipleValueTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testWhenEqualIsFalse(): void
6060
public function testInvalidProperty(): void
6161
{
6262
$this->expectException(InvalidProperty::class);
63-
$this->expectErrorMessage('Invalid property <other> for class <TinyBlocks\Vo\Mock\MultipleValueMock>.');
63+
$this->expectExceptionMessage('Invalid property <other> for class <TinyBlocks\Vo\Mock\MultipleValueMock>.');
6464

6565
$multiple = new MultipleValueMock(
6666
id: 123,
@@ -69,13 +69,13 @@ public function testInvalidProperty(): void
6969
new TransactionMock(id: 200, amount: new AmountMock(value: 11.01, currency: 'BRL'))
7070
]
7171
);
72-
$multiple->__get('other');
72+
$multiple->__get(key: 'other');
7373
}
7474

7575
public function testPropertyCannotBeChanged(): void
7676
{
7777
$this->expectException(PropertyCannotBeChanged::class);
78-
$this->expectErrorMessage(
78+
$this->expectExceptionMessage(
7979
'Property <other> cannot be changed in class <TinyBlocks\Vo\Mock\MultipleValueMock>.'
8080
);
8181

@@ -86,13 +86,13 @@ public function testPropertyCannotBeChanged(): void
8686
new TransactionMock(id: 200, amount: new AmountMock(value: 11.01, currency: 'BRL'))
8787
]
8888
);
89-
$multiple->__set('other', new StdClass());
89+
$multiple->__set(key: 'other', value: new StdClass());
9090
}
9191

9292
public function testPropertyCannotBeDeactivated(): void
9393
{
9494
$this->expectException(PropertyCannotBeDeactivated::class);
95-
$this->expectErrorMessage(
95+
$this->expectExceptionMessage(
9696
'Property <other> cannot be deactivated in class <TinyBlocks\Vo\Mock\MultipleValueMock>.'
9797
);
9898

@@ -103,6 +103,6 @@ public function testPropertyCannotBeDeactivated(): void
103103
new TransactionMock(id: 200, amount: new AmountMock(value: 11.01, currency: 'BRL'))
104104
]
105105
);
106-
$multiple->__unset('other');
106+
$multiple->__unset(key: 'other');
107107
}
108108
}

tests/SingleValueTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,34 @@ public function testWhenEqualIsFalse(): void
3434
public function testInvalidProperty(): void
3535
{
3636
$this->expectException(InvalidProperty::class);
37-
$this->expectErrorMessage('Invalid property <other> for class <TinyBlocks\Vo\Mock\SingleValueMock>.');
37+
$this->expectExceptionMessage('Invalid property <other> for class <TinyBlocks\Vo\Mock\SingleValueMock>.');
3838

3939
$single = new SingleValueMock(id: 1);
4040

41-
$single->__get('other');
41+
$single->__get(key: 'other');
4242
}
4343

4444
public function testPropertyCannotBeChanged(): void
4545
{
4646
$this->expectException(PropertyCannotBeChanged::class);
47-
$this->expectErrorMessage('Property <other> cannot be changed in class <TinyBlocks\Vo\Mock\SingleValueMock>.');
47+
$this->expectExceptionMessage(
48+
'Property <other> cannot be changed in class <TinyBlocks\Vo\Mock\SingleValueMock>.'
49+
);
4850

4951
$single = new SingleValueMock(id: 1);
5052

51-
$single->__set('other', new StdClass());
53+
$single->__set(key: 'other', value: new StdClass());
5254
}
5355

5456
public function testPropertyCannotBeDeactivated(): void
5557
{
5658
$this->expectException(PropertyCannotBeDeactivated::class);
57-
$this->expectErrorMessage(
59+
$this->expectExceptionMessage(
5860
'Property <other> cannot be deactivated in class <TinyBlocks\Vo\Mock\SingleValueMock>.'
5961
);
6062

6163
$single = new SingleValueMock(id: 1);
6264

63-
$single->__unset('other');
65+
$single->__unset(key: 'other');
6466
}
6567
}

0 commit comments

Comments
 (0)