2024-06-27 00:00:29 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Fileshare;
|
|
|
|
|
|
|
|
use App\Fileshare\ConnectionTypes\OwncloudConnection;
|
|
|
|
use App\Fileshare\Models\FileshareConnection;
|
|
|
|
use Tests\FileshareTestCase;
|
|
|
|
|
2024-06-27 11:00:35 +02:00
|
|
|
class IndexActionTest extends FileshareTestCase
|
2024-06-27 00:00:29 +02:00
|
|
|
{
|
|
|
|
public function testItListsOwncloudConnectionsThatAreActive(): void
|
|
|
|
{
|
|
|
|
$this->withoutExceptionHandling()->login()->loginNami()->withOwncloudUser('badenpowell', 'secret');
|
2024-06-27 00:05:23 +02:00
|
|
|
$connection = FileshareConnection::factory()
|
2024-06-27 00:00:29 +02:00
|
|
|
->type(OwncloudConnection::from(['user' => 'badenpowell', 'password' => 'secret', 'base_url' => env('TEST_OWNCLOUD_DOMAIN')]))
|
|
|
|
->name('lokaler Server')
|
|
|
|
->create();
|
|
|
|
|
|
|
|
$this->get('/setting/fileshare')
|
|
|
|
->assertInertiaPath('data.data.0.name', 'lokaler Server')
|
2024-06-27 00:05:23 +02:00
|
|
|
->assertInertiaPath('data.data.0.type', OwncloudConnection::class)
|
|
|
|
->assertInertiaPath('data.data.0.config.user', 'badenpowell')
|
|
|
|
->assertInertiaPath('data.data.0.config.password', 'secret')
|
|
|
|
->assertInertiaPath('data.data.0.config.base_url', env('TEST_OWNCLOUD_DOMAIN'))
|
|
|
|
->assertInertiaPath('data.data.0.id', $connection->id)
|
2024-06-27 00:00:29 +02:00
|
|
|
->assertInertiaPath('data.data.0.is_active', true);
|
|
|
|
}
|
|
|
|
}
|