Skip to content

Commit 0d952d6

Browse files
committed
Replace deprecated methods in PHPUnit
1 parent 052a189 commit 0d952d6

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

tests/Fixtures/HelperTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function setUpManagerMock(): void
166166

167167
$this->manager->expects($this->any())
168168
->method('getFactory')
169-
->will($this->returnValue($factory));
169+
->willReturn($factory);
170170

171171
$this->manager->expects($this->any())
172172
->method('getParam')

tests/Unit/Serializer/ArraySerializerTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ public function testSerialize(): void
2323
$object2 = new \stdClass();
2424

2525
$data = $this->createMock(Accessable::class);
26-
$data->method('get')->will($this->returnValueMap([
26+
$data->method('get')->willReturnMap([
2727
['AccessObject', $object1],
2828
['object', $object2],
2929
['array', []],
3030
['string', 'string'],
3131
['integer', 1],
3232
['boolean', true],
3333
['null', null],
34-
]));
34+
]);
3535
$data->method('getKeys')->willReturn([
3636
'AccessObject',
3737
'object',
@@ -64,14 +64,14 @@ public function testRecursiveSerialize(): void
6464
$stdObject->key = 'value';
6565

6666
$object1 = $this->createMock(Accessable::class);
67-
$object1->method('get')->will($this->returnValueMap([
67+
$object1->method('get')->willReturnMap([
6868
['object', $stdObject],
6969
['array', []],
7070
['string', 'string'],
7171
['integer', 1],
7272
['boolean', true],
7373
['null', null],
74-
]));
74+
]);
7575
$object1->method('getKeys')->willReturn([
7676
'object',
7777
'array',
@@ -82,9 +82,9 @@ public function testRecursiveSerialize(): void
8282
]);
8383

8484
$data = $this->createMock(Accessable::class);
85-
$data->method('get')->will($this->returnValueMap([
85+
$data->method('get')->willReturnMap([
8686
['AccessObject', $object1],
87-
]));
87+
]);
8888
$data->method('getKeys')->willReturn([
8989
'AccessObject',
9090
]);

tests/Unit/V1/DocumentLinkTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function setUp(): void
3333
$this->parent->expects($this->any())
3434
->method('has')
3535
->with('data')
36-
->will($this->returnValue(true));
36+
->willReturn(true);
3737
}
3838

3939
/**

tests/Unit/V1/RelationshipCollectionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function testCreateWithIdPropertyThrowsException(): void
121121
$item->expects($this->any())
122122
->method('has')
123123
->with($this->equalTo('attributes'))
124-
->will($this->returnValue(false));
124+
->willReturn(false);
125125

126126
$object = new \stdClass();
127127
$object->id = '5';

tests/Unit/V1/RelationshipLinkTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public function setUp(): void
4242
$this->relationship->expects($this->any())
4343
->method('has')
4444
->with($this->equalTo('data'))
45-
->will($this->returnValue(true));
45+
->willReturn(true);
4646

4747
$this->relationship->expects($this->any())
4848
->method('get')
4949
->with($this->equalTo('data'))
50-
->will($this->returnValue($collection));
50+
->willReturn($collection);
5151
}
5252

5353
/**
@@ -136,7 +136,7 @@ public function testPaginationNotParsedIfRelationshipDataNotExists(): void
136136
$relationship->expects($this->any())
137137
->method('has')
138138
->with($this->equalTo('data'))
139-
->will($this->returnValue(false));
139+
->willReturn(false);
140140

141141
$link = new RelationshipLink($object, $this->manager, $relationship);
142142

@@ -173,15 +173,15 @@ public function testPaginationNotParsedIfRelationshipIdentifierCollectionNotExis
173173
$relationship->expects($this->any())
174174
->method('has')
175175
->with($this->equalTo('data'))
176-
->will($this->returnValue(true));
176+
->willReturn(true);
177177

178178
// Mock identifier item
179179
$data = $this->createMock(Accessable::class);
180180

181181
$relationship->expects($this->any())
182182
->method('get')
183183
->with($this->equalTo('data'))
184-
->will($this->returnValue($data));
184+
->willReturn($data);
185185

186186
$link = new RelationshipLink($object, $this->manager, $relationship);
187187

0 commit comments

Comments
 (0)