diff --git a/lib/Feed.php b/lib/Feed.php index 9119912..324cbf5 100644 --- a/lib/Feed.php +++ b/lib/Feed.php @@ -69,7 +69,7 @@ class Feed { // used instead of the feed's url. $this->favicon = (new Favicon)->find($feed->siteUrl); } catch (PicoFeedException $e) { - throw new Feed\Exception($url, $e); + throw new Feed\Exception($this->resource->getUrl(), $e); } // PicoFeed does not provide valid ids when there is no id element. Its solution diff --git a/tests/test b/tests/test index 809959c..4e18ac2 100644 --- a/tests/test +++ b/tests/test @@ -1,7 +1,7 @@ #! /bin/sh base=`dirname "$0"` -php -S localhost:8000 "$base/server.php" >/dev/null & +php -n -S localhost:8000 "$base/server.php" >/dev/null & php "$base/../vendor/phpunit/phpunit/phpunit" -c "$base/phpunit.xml" sleep 1s -pid=`netstat -tlpn 2>/dev/null | grep ":8000 " | grep -Eo "[0-9]+/php" | grep -Eo "[0-9]+"` +pid=`lsof -n -i:8000 | grep -Eo "php\s+[0-9]+" | grep -Eo "[0-9]+"` kill $pid \ No newline at end of file diff --git a/tests/test.bat b/tests/test.bat index 0392fdb..21ff7fd 100644 --- a/tests/test.bat +++ b/tests/test.bat @@ -1,7 +1,7 @@ @echo off setlocal set base=%~dp0 -start /b php -S localhost:8000 "%base%\server.php" >nul +start /b php -n -S localhost:8000 "%base%\server.php" >nul php "%base%\..\vendor\phpunit\phpunit\phpunit" -c "%base%\phpunit.xml" timeout /nobreak /t 1 >nul for /f "usebackq tokens=5" %%a in (`netstat -aon ^| find "LISTENING" ^| find ":8000"`) do (