Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,25 @@ jobs:

name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }}

services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

runs-on: ${{ matrix.operating-system }}

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring
extensions: mbstring, sqlite3
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Setup composer cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
7 changes: 4 additions & 3 deletions tests/SignedUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Carbon\Carbon;
use Faker\Factory as Faker;
use Grosv\LaravelPasswordlessLogin\Exceptions\InvalidSignatureException;
use Grosv\LaravelPasswordlessLogin\Exceptions\ExpiredSignatureException;
use Grosv\LaravelPasswordlessLogin\Exceptions\InvalidSignatureException;
use Grosv\LaravelPasswordlessLogin\LoginUrl;
use Grosv\LaravelPasswordlessLogin\Models\Models\User as ModelUser;
use Grosv\LaravelPasswordlessLogin\Models\User;
Expand Down Expand Up @@ -118,14 +118,15 @@ public function allows_alternative_auth_model()
$this->url = $generator->generate();
$response = $this->followingRedirects()->get($this->url);
$response->assertSuccessful();
$response->assertSee($this->model_user->name);
// without 'false' you might have html encoded characters breaking the test - e.g. Donald O'Duck
$response->assertSee($this->model_user->name, false);
$this->assertAuthenticatedAs($this->model_user);
}

/** @test */
public function an_expired_request_will_not_log_user_in()
{
sleep(config('laravel-passwordless-login.login_route_expires') + 1);
\Illuminate\Support\Carbon::setTestNow(Carbon::now()->addMinutes(config('laravel-passwordless-login.login_route_expires') + 1));

// Make sure 401 is returned
$this->assertGuest();
Expand Down