Skip to content

Commit

Permalink
Fix tests (#1486)
Browse files Browse the repository at this point in the history
* set @requires annotation into right test class

* fix flysystem tests
  • Loading branch information
guillaume-sainthillier authored Jan 23, 2025
1 parent 1703c01 commit f86dfa7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tests/Storage/Flysystem/AbstractFlysystemStorageTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ abstract class AbstractFlysystemStorageTestCase extends StorageTestCase

abstract protected function createRegistry(FilesystemOperator $filesystem): MountManager|ContainerInterface;

/**
* @requires function MountManager::__construct
*/
public static function setUpBeforeClass(): void
{
}

protected function getStorage(): StorageInterface
{
return new FlysystemStorage($this->factory, $this->registry, $this->useFlysystemToResolveUri);
Expand Down Expand Up @@ -84,7 +77,7 @@ public function testUpload(): void

$this->filesystem
->expects(self::once())
->method('putStream')
->method('writeStream')
->with(
'originalName.txt',
$this->isType('resource'),
Expand Down Expand Up @@ -122,6 +115,8 @@ public function testRemoveOnNonExistentFile(): void
->method('getFileName')
->willReturn('not_found.txt');

$this->expectException(UnableToDeleteFile::class);
$this->expectExceptionMessage('dummy path');
$this->storage->remove($this->object, $this->mapping);
}

Expand Down Expand Up @@ -156,9 +151,9 @@ public static function pathProvider(): array
return [
// dir, path, relative
[null, 'file.txt', true],
[null, '/absolute/file.txt', false],
[null, 'file.txt', false],
['foo', 'foo/file.txt', true],
['foo', '/absolute/foo/file.txt', false],
['foo', 'foo/file.txt', false],
];
}

Expand Down
7 changes: 7 additions & 0 deletions tests/Storage/Flysystem/MountManagerFlysystemStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
*/
final class MountManagerFlysystemStorageTest extends AbstractFlysystemStorageTestCase
{
/**
* @requires function MountManager::__construct
*/
public static function setUpBeforeClass(): void
{
}

protected function createRegistry(FilesystemOperator $filesystem): MountManager
{
$mountManager = $this->createMock(MountManager::class);
Expand Down

0 comments on commit f86dfa7

Please sign in to comment.