Skip to content

Commit ba3d398

Browse files
author
matt
committed
Fix PHPUnit deprecations
1 parent e243e24 commit ba3d398

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

test/Model/Mapper/TypeMapperFactoryTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ public function testInvokeReturnsConfiguredInstance(): void
2121
{
2222
$expected = new ClassString(DateTimeImmutable::class);
2323
$schema = new Schema(['type' => 'string', 'format' => 'date']);
24-
$container = self::createStub(ContainerInterface::class);
25-
$container->method('get')
24+
$container = $this->createMock(ContainerInterface::class);
25+
$container->expects(self::once())
26+
->method('get')
2627
->with('config')
2728
->willReturn([
2829
ConfigProvider::GEN_KEY => [

test/Model/Mapper/TypeMapperTest.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ public function testMapReturnsClassString(): void
3333
$spec = ['type' => 'foo'];
3434
$schema = new Schema($spec);
3535

36-
$mapper = self::createStub(TypeMapperInterface::class);
37-
$mapper->method('canMap')
36+
$mapper = $this->createMock(TypeMapperInterface::class);
37+
$mapper->expects(self::once())
38+
->method('canMap')
3839
->with('foo', null)
3940
->willReturn(true);
40-
$mapper->method('getClassString')
41+
$mapper->expects(self::once())
42+
->method('getClassString')
4143
->with('foo', null)
4244
->willReturn($expected->getClassString());
4345

@@ -52,8 +54,9 @@ public function testMapCannotMapReturnPropertyType(): void
5254
$spec = ['type' => 'string', 'format' => 'datetime'];
5355
$schema = new Schema($spec);
5456

55-
$mapper = self::createStub(TypeMapperInterface::class);
56-
$mapper->method('canMap')
57+
$mapper = $this->createMock(TypeMapperInterface::class);
58+
$mapper->expects(self::once())
59+
->method('canMap')
5760
->with('string', 'datetime')
5861
->willReturn(false);
5962

0 commit comments

Comments
 (0)