Browse Source

Fix feed timeout test; improves #113

microsub
J. King 6 years ago
parent
commit
415f7fd385
  1. 12
      tests/cases/Feed/TestFeedFetching.php
  2. 2
      tests/docroot/Feed/Fetching/Timeout.php

12
tests/cases/Feed/TestFeedFetching.php

@ -54,12 +54,6 @@ class TestFeedFetching extends Test\AbstractTest {
new Feed(null, $this->base."Fetching/EndlessLoop?i=0");
}
public function testHandleATimeout() {
Arsse::$conf->fetchTimeout = 1;
$this->assertException("timeout", "Feed");
new Feed(null, $this->base."Fetching/Timeout");
}
public function testHandleAnOverlyLargeFeed() {
Arsse::$conf->fetchSizeLimit = 512;
$this->assertException("maxSize", "Feed");
@ -70,4 +64,10 @@ class TestFeedFetching extends Test\AbstractTest {
$this->assertException("invalidCertificate", "Feed");
new Feed(null, "https://localhost:8000/");
}
public function testHandleATimeout() {
Arsse::$conf->fetchTimeout = 1;
$this->assertException("timeout", "Feed");
new Feed(null, $this->base."Fetching/Timeout");
}
}

2
tests/docroot/Feed/Fetching/Timeout.php

@ -1,5 +1,5 @@
<?php
sleep(5);
usleep(1.05 * 1000000);
return [
'code' => 404,
'cache' => false,

Loading…
Cancel
Save