Skip to content

Commit f97ab23

Browse files
authored
Merge pull request #601 from FriendsOfSymfony/dispatch
allow to trigger workflows manually
2 parents 7805dc0 + bcba9a2 commit f97ab23

10 files changed

Lines changed: 27 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- "*.x"
77
pull_request:
8+
workflow_dispatch:
89

910
env:
1011
DEPENDENCIES: 'toflar/psr6-symfony-http-cache-store:^2|^3|^4'

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- "*.x"
77
pull_request:
8+
workflow_dispatch:
89

910
jobs:
1011
build:

.github/workflows/static.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- "*.x"
77
pull_request:
8+
workflow_dispatch:
89

910
jobs:
1011
phpstan-src:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
vendor/
22
composer.lock
33
phpunit.xml
4+
phpstan.neon
45
doc/_build/
56
.php-cs-fixer.cache
67
puli.json

tests/Functional/Symfony/EventDispatchingHttpCacheTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public function testEventListeners(): void
4444
->shouldReceive('handle')
4545
->andReturn($expectedResponse)
4646
->getMock();
47-
// https://github.com/phpstan/phpstan-mockery/issues/8
48-
/** @phpstan-ignore-next-line */
4947
$store = \Mockery::mock(StoreInterface::class)
5048
->shouldReceive('lookup')->andReturn(null)->times(1)
49+
// https://github.com/phpstan/phpstan-mockery/issues/8
50+
/* @phpstan-ignore-next-line */
5151
->shouldReceive('write')->times(1)
5252
->shouldReceive('unlock')->times(1)
5353
// need to declare the cleanup function explicitly to avoid issue between register_shutdown_function and mockery

tests/Functional/Varnish/UserContextFailureTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ class UserContextFailureTest extends VarnishTestCase
2626
public function setUp(): void
2727
{
2828
// needs to be decided before doing the setup
29-
// phpunit 9 calls the method getName(), phpunit 10 name()
30-
$name = method_exists($this, 'name') ? $this->name() : $this->getName(); /* @phpstan-ignore-line */
31-
$this->mode = 'testHashRequestFailure' === $name ? 'failure' : 'cache';
29+
$this->mode = 'testHashRequestFailure' === $this->name() ? 'failure' : 'cache';
3230

3331
parent::setUp();
3432
}

tests/Unit/CacheInvalidatorTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ public function testSupportsInvalid(): void
7878
public function testInvalidatePath(): void
7979
{
8080
/** @var MockInterface&PurgeCapable $purge */
81-
// https://github.com/phpstan/phpstan-mockery/issues/8
82-
/** @phpstan-ignore-next-line */
8381
$purge = \Mockery::mock(PurgeCapable::class)
8482
->shouldReceive('purge')->once()->with('/my/route', [])
83+
// https://github.com/phpstan/phpstan-mockery/issues/8
84+
/* @phpstan-ignore-next-line */
8585
->shouldReceive('purge')->once()->with('/my/route', ['X-Test-Header' => 'xyz'])
8686
->shouldReceive('flush')->once()
8787
->getMock();
@@ -99,10 +99,10 @@ public function testRefreshPath(): void
9999
{
100100
$headers = ['X' => 'Y'];
101101
/** @var MockInterface&RefreshCapable $refresh */
102-
// https://github.com/phpstan/phpstan-mockery/issues/8
103-
/** @phpstan-ignore-next-line */
104102
$refresh = \Mockery::mock(RefreshCapable::class)
105103
->shouldReceive('refresh')->once()->with('/my/route', $headers)
104+
// https://github.com/phpstan/phpstan-mockery/issues/8
105+
/* @phpstan-ignore-next-line */
106106
->shouldReceive('flush')->never()
107107
->getMock();
108108

@@ -194,10 +194,10 @@ public function testProxyClientExceptionsAreLogged(): void
194194

195195
$unreachableException = ProxyUnreachableException::proxyUnreachable($clientException);
196196

197-
// https://github.com/phpstan/phpstan-mockery/issues/8
198-
/** @phpstan-ignore-next-line */
199197
$response = \Mockery::mock(ResponseInterface::class)
200198
->shouldReceive('getStatusCode')->andReturn(403)
199+
// https://github.com/phpstan/phpstan-mockery/issues/8
200+
/* @phpstan-ignore-next-line */
201201
->shouldReceive('getReasonPhrase')->andReturn('Forbidden')
202202
->getMock();
203203
$responseException = ProxyResponseException::proxyResponse(new HttpException('test', $failedRequest, $response));
@@ -212,15 +212,15 @@ public function testProxyClientExceptionsAreLogged(): void
212212

213213
$cacheInvalidator = new CacheInvalidator($proxyClient);
214214

215-
// https://github.com/phpstan/phpstan-mockery/issues/8
216-
/** @phpstan-ignore-next-line */
217215
$logger = \Mockery::mock(LoggerInterface::class)
218216
->shouldReceive('log')->once()
219217
->with(
220218
'critical',
221219
'Request to caching proxy at 127.0.0.1 failed with message "Couldn\'t connect to host"',
222220
['exception' => $unreachableException]
223221
)
222+
// https://github.com/phpstan/phpstan-mockery/issues/8
223+
/* @phpstan-ignore-next-line */
224224
->shouldReceive('log')->once()
225225
->with(
226226
'critical',

tests/Unit/ResponseTaggerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ public function testGetTagsHeaderValue(): void
4848

4949
public function testTagResponseReplace(): void
5050
{
51-
// https://github.com/phpstan/phpstan-mockery/issues/8
52-
/** @phpstan-ignore-next-line */
5351
$headerFormatter = \Mockery::mock(TagHeaderFormatter::class)
5452
->shouldReceive('getTagsHeaderValue')
5553
->with(['tag-1', 'tag-2'])
5654
->once()
5755
->andReturn('tag-1,tag-2')
56+
// https://github.com/phpstan/phpstan-mockery/issues/8
57+
/* @phpstan-ignore-next-line */
5858
->shouldReceive('getTagsHeaderName')
5959
->once()
6060
->andReturn('FOS-Tags')
@@ -75,13 +75,13 @@ public function testTagResponseReplace(): void
7575

7676
public function testTagResponseAdd(): void
7777
{
78-
// https://github.com/phpstan/phpstan-mockery/issues/8
79-
/** @phpstan-ignore-next-line */
8078
$headerFormatter = \Mockery::mock(TagHeaderFormatter::class)
8179
->shouldReceive('getTagsHeaderValue')
8280
->with(['tag-1', 'tag-2'])
8381
->once()
8482
->andReturn('tag-1,tag-2')
83+
// https://github.com/phpstan/phpstan-mockery/issues/8
84+
/* @phpstan-ignore-next-line */
8585
->shouldReceive('getTagsHeaderName')
8686
->once()
8787
->andReturn('FOS-Tags')
@@ -109,10 +109,10 @@ public function testTagResponseNoTags(): void
109109

110110
$tagger = new ResponseTagger(['header_formatter' => $headerFormatter]);
111111

112-
// https://github.com/phpstan/phpstan-mockery/issues/8
113-
/** @phpstan-ignore-next-line */
114112
$response = \Mockery::mock(ResponseInterface::class)
115113
->shouldReceive('withHeader')->never()
114+
// https://github.com/phpstan/phpstan-mockery/issues/8
115+
/* @phpstan-ignore-next-line */
116116
->shouldReceive('withAddedHeader')->never()
117117
->getMock();
118118

tests/Unit/Test/PHPUnit/IsCacheHitConstraintTestCase.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public function setUp(): void
2626

2727
public function testMatches(): void
2828
{
29-
// https://github.com/phpstan/phpstan-mockery/issues/8
30-
/** @phpstan-ignore-next-line */
3129
$response = $this->getResponseMock()
3230
->shouldReceive('hasHeader')->with('cache-header')->andReturn(true)
31+
// https://github.com/phpstan/phpstan-mockery/issues/8
32+
/* @phpstan-ignore-next-line */
3333
->shouldReceive('getHeaderLine')->with('cache-header')->once()->andReturn('MISS')
3434
->shouldReceive('getStatusCode')->andReturn(500)
3535
->shouldReceive('getHeaders')->andReturn([])
@@ -46,10 +46,10 @@ public function testMatchesThrowsExceptionIfHeaderIsMissing(): void
4646
$this->expectException(\RuntimeException::class);
4747
$this->expectExceptionMessage('Response has no "cache-header" header');
4848

49-
// https://github.com/phpstan/phpstan-mockery/issues/8
50-
/** @phpstan-ignore-next-line */
5149
$response = $this->getResponseMock()
5250
->shouldReceive('hasHeader')->with('cache-header')->once()->andReturn(false)
51+
// https://github.com/phpstan/phpstan-mockery/issues/8
52+
/* @phpstan-ignore-next-line */
5353
->shouldReceive('getStatusCode')->andReturn(200)
5454
->shouldReceive('getHeaders')->andReturn([])
5555
->shouldReceive('getBody')->andReturn(new Stream(fopen('php://temp', 'r+')))

tests/Unit/Test/PHPUnit/IsCacheMissConstraintTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public function setUp(): void
2525

2626
public function testMatches(): void
2727
{
28-
// https://github.com/phpstan/phpstan-mockery/issues/8
29-
/** @phpstan-ignore-next-line */
3028
$response = $this->getResponseMock()
3129
->shouldReceive('hasHeader')->with('cache-header')->andReturn(true)
30+
// https://github.com/phpstan/phpstan-mockery/issues/8
31+
/* @phpstan-ignore-next-line */
3232
->shouldReceive('getHeaderLine')->with('cache-header')->once()->andReturn('HIT')
3333
->shouldReceive('getStatusCode')->andReturn(200)
3434
->getMock();

0 commit comments

Comments
 (0)