Skip to content

Commit 3a12dc8

Browse files
authored
update deprecated phpunit calls (#24)
1 parent f08b600 commit 3a12dc8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/ContentfulTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function testThrowsResourceUnavailableExceptionIfFailResponseCachedInFall
314314
$spaces = array_merge_recursive($this->spaces, ['test' => ['cache' => $frontCachePool, 'fallback_cache' => $fallbackCachePool]]);
315315
$contentful = $this->getContentful($spaces, array_merge($this->options, $handlerOption));
316316
$parameters = [new LessThanFilter(new FieldProperty('ghosts'), 6), new EqualFilter(new FieldProperty('old'), 6)];
317-
$this->setExpectedException('Markup\Contentful\Exception\ResourceUnavailableException');
317+
$this->expectException(ResourceUnavailableException::class);
318318
$contentful->getEntries($parameters);
319319
}
320320

@@ -340,7 +340,7 @@ public function testFailResponseDoesNotSaveIntoFallbackCacheEvenIfCachingFailRes
340340
$spaces = array_merge_recursive($this->spaces, ['test' => ['cache' => $frontCachePool, 'fallback_cache' => $fallbackCachePool]]);
341341
$contentful = $this->getContentful($spaces, array_merge($this->options, $handlerOption, ['cache_fail_responses' => true]));
342342
$parameters = [new LessThanFilter(new FieldProperty('ghosts'), 6), new EqualFilter(new FieldProperty('old'), 6)];
343-
$this->setExpectedException('Markup\Contentful\Exception\ResourceUnavailableException');
343+
$this->expectException(ResourceUnavailableException::class);
344344
$contentful->getEntries($parameters);
345345
}
346346

@@ -408,7 +408,7 @@ public function testInvalidResponseDoesNotSaveIntoFallbackCacheEvenIfCachingFail
408408
$spaces = array_merge_recursive($this->spaces, ['test' => ['cache' => $frontCachePool, 'fallback_cache' => $fallbackCachePool]]);
409409
$contentful = $this->getContentful($spaces, array_merge($this->options, $handlerOption, ['cache_fail_responses' => true]));
410410
$parameters = [new LessThanFilter(new FieldProperty('ghosts'), 6), new EqualFilter(new FieldProperty('old'), 6)];
411-
$this->setExpectedException('Markup\Contentful\Exception\ResourceUnavailableException');
411+
$this->expectException(ResourceUnavailableException::class);
412412
$contentful->getEntries($parameters, null, [
413413
'test' => function ($builtResponse) {
414414
if (!$builtResponse instanceof ResourceArray) {
@@ -538,7 +538,7 @@ public function testGetNonExistentResourceWhenCachedThrowsWithoutRequest()
538538
$spaces = array_merge_recursive($this->spaces, ['test' => ['cache' => $cachePool, 'preview_mode' => false]]);
539539
$handlerOption = $this->getExplodyHandlerOption();
540540
$contentful = $this->getContentful($spaces, array_merge($this->options, $handlerOption, ['cache_fail_responses' => true]));
541-
$this->setExpectedException(ResourceUnavailableException::class);
541+
$this->expectException(ResourceUnavailableException::class);
542542
$contentful->getEntry('cat');
543543
}
544544

tests/Filter/MimeTypeGroupFilterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testGetName()
3939

4040
public function testCannotCreateWithUnknownValue()
4141
{
42-
$this->setExpectedException('InvalidArgumentException');
42+
$this->expectException(\InvalidArgumentException::class);
4343
new MimeTypeGroupFilter('unknown');
4444
}
4545
}

0 commit comments

Comments
 (0)