diff options
Diffstat (limited to 'tests/lib/Files/Storage/Storage.php')
-rw-r--r-- | tests/lib/Files/Storage/Storage.php | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/tests/lib/Files/Storage/Storage.php b/tests/lib/Files/Storage/Storage.php index 96af5e9fb23..51bb5b7c8ad 100644 --- a/tests/lib/Files/Storage/Storage.php +++ b/tests/lib/Files/Storage/Storage.php @@ -51,9 +51,7 @@ abstract class Storage extends \Test\TestCase { $this->assertTrue($this->instance->test()); } - /** - * @dataProvider directoryProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('directoryProvider')] public function testDirectories($directory): void { $this->assertFalse($this->instance->file_exists('/' . $directory)); @@ -144,9 +142,8 @@ abstract class Storage extends \Test\TestCase { /** * test the various uses of file_get_contents and file_put_contents - * - * @dataProvider loremFileProvider */ + #[\PHPUnit\Framework\Attributes\DataProvider('loremFileProvider')] public function testGetPutContents($sourceFile): void { $sourceText = file_get_contents($sourceFile); @@ -212,9 +209,7 @@ abstract class Storage extends \Test\TestCase { ); } - /** - * @dataProvider copyAndMoveProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('copyAndMoveProvider')] public function testCopy($source, $target): void { $this->initSourceAndTarget($source); @@ -225,9 +220,7 @@ abstract class Storage extends \Test\TestCase { $this->assertTrue($this->instance->file_exists($source), $source . ' was deleted'); } - /** - * @dataProvider copyAndMoveProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('copyAndMoveProvider')] public function testMove($source, $target): void { $this->initSourceAndTarget($source); @@ -239,9 +232,7 @@ abstract class Storage extends \Test\TestCase { $this->assertSameAsLorem($target); } - /** - * @dataProvider copyAndMoveProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('copyAndMoveProvider')] public function testCopyOverwrite($source, $target): void { $this->initSourceAndTarget($source, $target); @@ -253,9 +244,7 @@ abstract class Storage extends \Test\TestCase { $this->assertSameAsLorem($source); } - /** - * @dataProvider copyAndMoveProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('copyAndMoveProvider')] public function testMoveOverwrite($source, $target): void { $this->initSourceAndTarget($source, $target); @@ -352,9 +341,7 @@ abstract class Storage extends \Test\TestCase { $this->assertFalse($this->instance->file_exists('/lorem.txt')); } - /** - * @dataProvider fileNameProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('fileNameProvider')] public function testFOpen($fileName): void { $textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt'; @@ -424,9 +411,7 @@ abstract class Storage extends \Test\TestCase { ]; } - /** - * @dataProvider hashProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('hashProvider')] public function testHash($data, $type): void { $this->instance->file_put_contents('hash.txt', $data); $this->assertEquals(hash($type, $data), $this->instance->hash($type, 'hash.txt')); @@ -580,9 +565,7 @@ abstract class Storage extends \Test\TestCase { $this->assertFalse($this->instance->instanceOfStorage('\OC')); } - /** - * @dataProvider copyAndMoveProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('copyAndMoveProvider')] public function testCopyFromSameStorage($source, $target): void { $this->initSourceAndTarget($source); |