Skip to content

Commit 10704b7

Browse files
committed
wip
1 parent 637c58b commit 10704b7

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

tests/Feature/AuthTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Contracts\Auth\PasswordBroker;
77
use Illuminate\Foundation\Testing\DatabaseMigrations;
88
use Illuminate\Support\Facades\Auth;
9+
use Illuminate\Support\Facades\Http;
910
use Illuminate\Support\Facades\Notification;
1011
use Illuminate\Support\HtmlString;
1112
use Tests\TestCase;
@@ -211,6 +212,10 @@
211212
// Insert a password reset token into the database.
212213
$token = $this->app[PasswordBroker::class]->getRepository()->create($user);
213214

215+
// Http::fake([
216+
// 'api.pwnedpasswords.com/*' => Http::response('password:3600895'),
217+
// ]);
218+
214219
$response = $this->post('/password/reset', [
215220
'token' => $token,
216221
'email' => '[email protected]',

tests/Feature/SettingsTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Foundation\Testing\DatabaseMigrations;
66
use Illuminate\Support\Facades\Auth;
77
use Illuminate\Support\Facades\Hash;
8+
use Illuminate\Support\Facades\Http;
89
use Tests\TestCase;
910

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

113+
// Http::fake([
114+
// 'api.pwnedpasswords.com/*' => Http::response('newpassword:3600895'),
115+
// ]);
116+
112117
$response = $this->actingAs($user)
113118
->put('settings/password', [
114119
'current_password' => 'password',

tests/Pest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use Illuminate\Support\Facades\Http;
4+
35
/*
46
|--------------------------------------------------------------------------
57
| Test Case
@@ -13,6 +15,10 @@
1315

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

18+
// pest()->beforeEach(function () {
19+
// Http::preventStrayRequests();
20+
// })->in('Feature', 'Integration');
21+
1622
/*
1723
|--------------------------------------------------------------------------
1824
| Expectations

0 commit comments

Comments
 (0)