adrema/tests/Fileshare/FileshareFilesActionTest.php

26 lines
883 B
PHP
Raw Normal View History

2024-06-28 22:26:38 +02:00
<?php
namespace Tests\Fileshare;
use App\Fileshare\ConnectionTypes\OwncloudConnection;
use App\Fileshare\Models\Fileshare;
use Tests\FileshareTestCase;
class FileshareFilesActionTest extends FileshareTestCase
{
public function testItGetsFilesForAConnection(): void
{
$this->withoutExceptionHandling()->login()->loginNami()->withOwncloudUser('badenpowell', 'secret')
->withDirs('badenpowell', ['/pictures', '/lala']);
$connection = Fileshare::factory()
->type(OwncloudConnection::from(['user' => 'badenpowell', 'password' => 'secret', 'base_url' => env('TEST_OWNCLOUD_DOMAIN')]))
->create();
$this->postJson(route('fileshare.files', ['fileshare' => $connection]), [
'parent' => null,
])->assertJsonPath('data.0.name', 'pictures')
->assertJsonPath('data.1.name', 'lala');
}
}