Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Nov 1, 2024
1 parent 637c58b commit 10704b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/Feature/AuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Contracts\Auth\PasswordBroker;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\HtmlString;
use Tests\TestCase;
Expand Down Expand Up @@ -211,6 +212,10 @@
// Insert a password reset token into the database.
$token = $this->app[PasswordBroker::class]->getRepository()->create($user);

// Http::fake([
// 'api.pwnedpasswords.com/*' => Http::response('password:3600895'),
// ]);

$response = $this->post('/password/reset', [
'token' => $token,
'email' => '[email protected]',
Expand Down
5 changes: 5 additions & 0 deletions tests/Feature/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;

uses(TestCase::class);
Expand Down Expand Up @@ -109,6 +110,10 @@
test('users cannot update their password when it has been compromised in data leaks', function () {
$user = $this->login();

// Http::fake([
// 'api.pwnedpasswords.com/*' => Http::response('newpassword:3600895'),
// ]);

$response = $this->actingAs($user)
->put('settings/password', [
'current_password' => 'password',
Expand Down
6 changes: 6 additions & 0 deletions tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Illuminate\Support\Facades\Http;

/*
|--------------------------------------------------------------------------
| Test Case
Expand All @@ -13,6 +15,10 @@

/** @link https://pestphp.com/docs/underlying-test-case */

// pest()->beforeEach(function () {
// Http::preventStrayRequests();
// })->in('Feature', 'Integration');

/*
|--------------------------------------------------------------------------
| Expectations
Expand Down

0 comments on commit 10704b7

Please sign in to comment.