Improve tests
This commit is contained in:
parent
427debaba4
commit
48d1c9a00b
18 changed files with 267 additions and 14 deletions
|
@ -4,6 +4,9 @@ namespace App\Http\Middleware;
|
|||
|
||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Authenticate extends Middleware
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,9 @@ use Closure;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,9 @@ namespace App\Http\Middleware;
|
|||
|
||||
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class TrustHosts extends Middleware
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -60,7 +60,7 @@ class ProcessLike implements ShouldQueue
|
|||
|
||||
//POSSE like
|
||||
try {
|
||||
$response = $client->request(
|
||||
$client->request(
|
||||
'POST',
|
||||
'https://brid.gy/publish/webmention',
|
||||
[
|
||||
|
@ -70,8 +70,8 @@ class ProcessLike implements ShouldQueue
|
|||
],
|
||||
]
|
||||
);
|
||||
} catch (RequestException $exception) {
|
||||
//no biggie
|
||||
} catch (RequestException) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -38,6 +38,8 @@ class AppServiceProvider extends ServiceProvider
|
|||
});
|
||||
|
||||
// Bind the Codebird client
|
||||
// Codebird gets mocked in tests
|
||||
// @codeCoverageIgnoreStart
|
||||
$this->app->bind('Codebird\Codebird', function () {
|
||||
Codebird::setConsumerKey(
|
||||
env('TWITTER_CONSUMER_KEY'),
|
||||
|
@ -53,6 +55,7 @@ class AppServiceProvider extends ServiceProvider
|
|||
|
||||
return $cb;
|
||||
});
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
/**
|
||||
* Paginate a standard Laravel Collection.
|
||||
|
|
|
@ -34,9 +34,7 @@ class HorizonServiceProvider extends HorizonApplicationServiceProvider
|
|||
protected function gate()
|
||||
{
|
||||
Gate::define('viewHorizon', function ($user) {
|
||||
return in_array($user->name, [
|
||||
'jonny',
|
||||
]);
|
||||
return $user->name === 'jonny';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,8 @@ class RouteServiceProvider extends ServiceProvider
|
|||
* Configure the rate limiters for the application.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
protected function configureRateLimiting()
|
||||
{
|
||||
|
|
|
@ -79,11 +79,12 @@ class BookmarkService
|
|||
}
|
||||
|
||||
/**
|
||||
* Given a URL, use browsershot to save an image of the page.
|
||||
* Given a URL, use `browsershot` to save an image of the page.
|
||||
*
|
||||
* @param string $url
|
||||
* @return string The uuid for the screenshot
|
||||
* @throws CouldNotTakeBrowsershot
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function saveScreenshot(string $url): string
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue