Fix tests
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2024-07-14 00:37:38 +02:00
parent cf93b8eff0
commit c8676aef6d
3 changed files with 14 additions and 10 deletions

View File

@ -10,20 +10,20 @@ class AdapterTest extends FileshareTestCase
{
public function testItGetsFilesInRoot(): void
{
$this->withoutExceptionHandling()->login()->loginNami()->withUser('badenpowell', 'secret')
$this->withoutExceptionHandling()->login()->loginNami()->withUser('badenpowell', 'oowoh2vahghai7aezahCeexae')
->withDirs('badenpowell', []);
$storage = OwncloudConnection::from(['user' => 'badenpowell', 'password' => 'secret', 'base_url' => env('TEST_OWNCLOUD_DOMAIN')])->getFilesystem();
$storage = OwncloudConnection::from(['user' => 'badenpowell', 'password' => 'oowoh2vahghai7aezahCeexae', 'base_url' => env('TEST_OWNCLOUD_DOMAIN')])->getFilesystem();
$storage->put('/test.pdf', '');
$this->assertEquals(['test.pdf'], $storage->files('/'));
}
public function testItGetsFilesInSubdirectory(): void
{
$this->withoutExceptionHandling()->login()->loginNami()->withUser('badenpowell', 'secret')
$this->withoutExceptionHandling()->login()->loginNami()->withUser('badenpowell', 'oowoh2vahghai7aezahCeexae')
->withDirs('badenpowell', ['/pictures']);
$storage = OwncloudConnection::from(['user' => 'badenpowell', 'password' => 'secret', 'base_url' => env('TEST_OWNCLOUD_DOMAIN')])->getFilesystem();
$storage = OwncloudConnection::from(['user' => 'badenpowell', 'password' => 'oowoh2vahghai7aezahCeexae', 'base_url' => env('TEST_OWNCLOUD_DOMAIN')])->getFilesystem();
$storage->put('/pictures/test.pdf', '');
$this->assertEquals([], $storage->files('/'));
$this->assertEquals(['pictures/test.pdf'], $storage->files('/pictures'));

View File

@ -31,9 +31,9 @@ class ExportSyncActionTest extends FileshareTestCase
public function testItUploadsRootFile(): void
{
$this->withoutExceptionHandling()->withUser('badenpowell', 'secret')->withDirs('badenpowell', ['/abc']);
$this->withoutExceptionHandling()->withUser('badenpowell', 'zai8hie3oozaiX5queey0Xa9a')->withDirs('badenpowell', ['/abc']);
$connection = Fileshare::factory()
->type(OwncloudConnection::from(['user' => 'badenpowell', 'password' => 'secret', 'base_url' => env('TEST_OWNCLOUD_DOMAIN')]))
->type(OwncloudConnection::from(['user' => 'badenpowell', 'password' => 'zai8hie3oozaiX5queey0Xa9a', 'base_url' => env('TEST_OWNCLOUD_DOMAIN')]))
->create();
$form = Form::factory()->name('Formular')->fields([
$this->textField('vorname'),
@ -49,9 +49,9 @@ class ExportSyncActionTest extends FileshareTestCase
public function testItUploadsGroupFile(): void
{
$this->withoutExceptionHandling()->withUser('badenpowell', 'secret')->withDirs('badenpowell', ['/abc', '/stamm']);
$this->withoutExceptionHandling()->withUser('badenpowell', 'Aejahpoopood1Keetaaghoe0Z')->withDirs('badenpowell', ['/abc', '/stamm']);
$connection = Fileshare::factory()
->type(OwncloudConnection::from(['user' => 'badenpowell', 'password' => 'secret', 'base_url' => env('TEST_OWNCLOUD_DOMAIN')]))
->type(OwncloudConnection::from(['user' => 'badenpowell', 'password' => 'Aejahpoopood1Keetaaghoe0Z', 'base_url' => env('TEST_OWNCLOUD_DOMAIN')]))
->create();
$group = Group::factory()->create(['fileshare' => FileshareResourceData::from(['connection_id' => $connection->id, 'resource' => '/stamm'])]);
$form = Form::factory()->name('Formular')->fields([

View File

@ -2,6 +2,7 @@
namespace Tests\Fileshare;
use App\Fileshare\ConnectionTypes\NextcloudConnection;
use App\Fileshare\ConnectionTypes\OwncloudConnection;
use App\Fileshare\Models\Fileshare;
use Tests\FileshareTestCase;
@ -28,9 +29,12 @@ class FileshareIndexActionTest extends FileshareTestCase
->assertJsonPath('data.0.links.update', route('fileshare.update', ['fileshare' => $connection]))
->assertJsonPath('meta.default.name', '')
->assertJsonPath('meta.links.store', route('fileshare.store'))
->assertJsonPath('meta.types.0.id', OwncloudConnection::class)
->assertJsonPath('meta.types.0.name', 'Owncloud')
->assertJsonPath('meta.types.0.id', NextcloudConnection::class)
->assertJsonPath('meta.types.0.name', 'Nextcloud')
->assertJsonPath('meta.types.0.defaults.base_url', '')
->assertJsonPath('meta.types.1.id', OwncloudConnection::class)
->assertJsonPath('meta.types.1.name', 'Owncloud')
->assertJsonPath('meta.types.1.defaults.base_url', '')
->assertJsonPath('meta.types.0.fields.1', ['label' => 'Benutzer', 'key' => 'user', 'type' => 'text']);
}