- Config: auth, services, logging, queue and database only repeated the
framework's own files and are gone; the others keep only the keys that
differ (app version, cache serializable_classes, session cookie name,
Markdown mail theme, the shares disk, three Octane values, Livewire's
pagination theme and payload guards).
- Email verification is removed: User never implemented MustVerifyEmail,
so it was never enforced, and SealShare has a single admin and no
registration. CreateNewUser goes with it.
- FileEncryptionService::encryptFile() and generateSalt() were only used
by tests; tests build files with encryptTestFile() in tests/Pest.php.
- The expiration options are defined once, as Share::EXPIRATIONS. "30 Days"
now lasts 30 days instead of a calendar month, and Admin settings only
save a default expiration that is one of the options.
- One-caller helpers are inlined, the uploader reads chunk responses with
XHR's responseType, and starter-kit leftovers are removed.
- Docker: PHP reads the PHP_* limits from the environment itself
(${VAR:-default} in uploads.ini); both entrypoints stop writing the ini.
docker-compose.yml shares the app and scheduler variables through one
anchor. The dev image installs gd for the screenshot publisher and fake
test images.
- Development runs in Docker only: the composer dev script, concurrently,
laravel/pail, laravel/sail, autoprefixer and the shell-quote override
are gone.
- phpunit.xml forces the test environment with <server> entries, so tests
run in the dev container no longer use its real database.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
77 lines
2.0 KiB
PHP
77 lines
2.0 KiB
PHP
<?php
|
|
|
|
use App\Models\User;
|
|
use Livewire\Livewire;
|
|
|
|
test('profile page is displayed', function () {
|
|
$this->actingAs($user = User::factory()->create());
|
|
|
|
$this->get(route('profile.edit'))->assertOk();
|
|
});
|
|
|
|
test('profile information can be updated', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = Livewire::test('pages::settings.profile')
|
|
->set('name', 'Test User')
|
|
->set('email', 'test@example.com')
|
|
->call('updateProfileInformation');
|
|
|
|
$response->assertHasNoErrors()
|
|
->assertDispatched('profile-updated')
|
|
->assertDispatched('toast', type: 'success', title: 'Saved.');
|
|
|
|
$user->refresh();
|
|
|
|
expect($user->name)->toEqual('Test User');
|
|
expect($user->email)->toEqual('test@example.com');
|
|
});
|
|
|
|
test('the profile saves with its own unchanged email address', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = Livewire::test('pages::settings.profile')
|
|
->set('name', 'Test User')
|
|
->set('email', $user->email)
|
|
->call('updateProfileInformation');
|
|
|
|
$response->assertHasNoErrors();
|
|
|
|
expect($user->refresh()->name)->toEqual('Test User');
|
|
});
|
|
|
|
test('user can delete their account', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = Livewire::test('pages::settings.delete-user-form')
|
|
->set('password', 'password')
|
|
->call('deleteUser');
|
|
|
|
$response
|
|
->assertHasNoErrors()
|
|
->assertRedirect('/');
|
|
|
|
expect($user->fresh())->toBeNull();
|
|
expect(auth()->check())->toBeFalse();
|
|
});
|
|
|
|
test('correct password must be provided to delete account', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = Livewire::test('pages::settings.delete-user-form')
|
|
->set('password', 'wrong-password')
|
|
->call('deleteUser');
|
|
|
|
$response->assertHasErrors(['password']);
|
|
|
|
expect($user->fresh())->not->toBeNull();
|
|
});
|