Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Add a forgotten expectation and remove one test. With phpunit 10 you
can't expect PHP errors anymore
(sebastianbergmann/phpunit#5062). But that's
OK, the test wasn't very valuable.
  • Loading branch information
otsch committed Feb 8, 2023
1 parent 12a64eb commit ac459d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 0 additions & 9 deletions tests/Loader/Http/HttpLoaderTest.php
Expand Up @@ -7,7 +7,6 @@
use Crwlr\Crawler\Loader\Http\Exceptions\LoadingException;
use Crwlr\Crawler\Loader\Http\HttpLoader;
use Crwlr\Crawler\Loader\Http\Politeness\Throttler;
use Crwlr\Crawler\Steps\Loading\Http;
use Crwlr\Crawler\UserAgents\BotUserAgent;
use Crwlr\Crawler\UserAgents\UserAgent;
use GuzzleHttp\Psr7\Request;
Expand Down Expand Up @@ -68,14 +67,6 @@ function helper_nonBotUserAgent(): UserAgent
$httpLoader->loadOrFail(new Request('GET', 'https://www.crwlr.software'));
});

test('It does not accept other argument types for the load method', function ($loadMethod) {
$httpClient = Mockery::mock(ClientInterface::class);

$httpLoader = new HttpLoader(new BotUserAgent('Foo'), $httpClient);

$httpLoader->{$loadMethod}(new stdClass());
})->with(['load', 'loadOrFail'])->expectError();

it(
'calls the before and after load hooks regardless whether the response was successful or not',
function ($responseStatusCode) {
Expand Down
Expand Up @@ -71,6 +71,8 @@ function helper_createResponseBodyWithPaginationLinks(array $links): string
$respondedRequest->request,
$respondedRequest,
);

expect($paginator->hasFinished())->toBeFalse();
});

it('has finished when the loaded pages count exceeds the max pages limit', function () {
Expand Down

0 comments on commit ac459d3

Please sign in to comment.