Skip to content

Commit a62c942

Browse files
authored
Merge pull request #277 from WyriHaximus/drop-dreprecated-methods
Drop deprecated methods
2 parents 68b88f2 + cb4c1de commit a62c942

File tree

6 files changed

+52
-114
lines changed

6 files changed

+52
-114
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"dealerdirect/phpcodesniffer-composer-installer": true,
4444
"ergebnis/composer-normalize": true,
4545
"icanhazstring/composer-unused": true,
46-
"infection/extension-installer": true
46+
"infection/extension-installer": true,
47+
"phpstan/extension-installer": true
4748
},
4849
"platform": {
4950
"php": "8.2.13"

composer.lock

Lines changed: 50 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

etc/qa/phpstan.neon

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
parameters:
22
excludePaths:
33
- tests/bootstrap.php
4-
ignoreErrors:
5-
- '#Method WyriHaximus\\AsyncTestUtilities\\CallableStub::__invoke\(\) is not final, but since the containing class is abstract, it should be.#'
6-
- '#Call to deprecated method expectCallableExactly\(\)#'
7-
- '#Call to deprecated method expectCallableOnce\(\)#'
84
ergebnis:
95
noExtends:
106
classesAllowedToBeExtended:

src/AsyncTestCase.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,10 @@
44

55
namespace WyriHaximus\AsyncTestUtilities;
66

7-
use PHPUnit\Framework\MockObject\Rule\InvokedCount;
87
use WyriHaximus\React\PHPUnit\RunTestsInFibersTrait;
98
use WyriHaximus\TestUtilities\TestCase;
109

1110
abstract class AsyncTestCase extends TestCase
1211
{
1312
use RunTestsInFibersTrait;
14-
15-
private const INVOKE_ARRAY = ['__invoke'];
16-
17-
/** @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.) */
18-
final protected function expectCallableExactly(int $amount): callable
19-
{
20-
return $this->getCallableMock(self::exactly($amount));
21-
}
22-
23-
/** @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.) */
24-
final protected function expectCallableOnce(): callable
25-
{
26-
return $this->getCallableMock(self::once());
27-
}
28-
29-
/** @deprecated With the move to fibers there is no need for these rarely used methods anymore. (Unless proven otherwise of course.) */
30-
final protected function expectCallableNever(): callable
31-
{
32-
return $this->getCallableMock(self::never());
33-
}
34-
35-
/** @psalm-suppress InvalidReturnType */
36-
private function getCallableMock(InvokedCount $invokedCount): callable
37-
{
38-
$mock = $this->getMockBuilder(CallableStub::class)->onlyMethods(self::INVOKE_ARRAY)->getMock();
39-
/** @psalm-suppress InternalMethod */
40-
$mock
41-
->expects($invokedCount)
42-
->method('__invoke');
43-
44-
/** @psalm-suppress InvalidReturnStatement */
45-
return $mock;
46-
}
4713
}

src/CallableStub.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/AsyncTestCaseTest.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,4 @@ public function testFiberGetCurrentReturnsAFiberInstance(): void
3434
{
3535
self::assertInstanceOf(Fiber::class, Fiber::getCurrent());
3636
}
37-
38-
public function testExpectCallableExactly(): void
39-
{
40-
$callable = $this->expectCallableExactly(3);
41-
42-
$callable();
43-
$callable();
44-
$callable();
45-
}
46-
47-
public function testExpectCallableOnce(): void
48-
{
49-
$this->expectCallableOnce()();
50-
}
5137
}

0 commit comments

Comments
 (0)