aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/FileUtilsTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-27 14:07:08 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-27 14:09:55 +0200
commitb1baca99f280570d0336b4d71ad1f9dca213a35b (patch)
tree518de2057da549d0baa982c6aa689aa813377774 /tests/FileUtilsTest.php
parent8f60e1206e45e67c96a7630d4ff94e72fe875f09 (diff)
downloadShaarli-b1baca99f280570d0336b4d71ad1f9dca213a35b.tar.gz
Shaarli-b1baca99f280570d0336b4d71ad1f9dca213a35b.tar.zst
Shaarli-b1baca99f280570d0336b4d71ad1f9dca213a35b.zip
Convert legacy PHPUnit @expected* to new ->expect*
Converted automatically using https://github.com/ArthurHoaro/convert-legacy-phpunit-expect
Diffstat (limited to 'tests/FileUtilsTest.php')
-rw-r--r--tests/FileUtilsTest.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/FileUtilsTest.php b/tests/FileUtilsTest.php
index eb9cb89a..6e8f44f2 100644
--- a/tests/FileUtilsTest.php
+++ b/tests/FileUtilsTest.php
@@ -49,12 +49,12 @@ class FileUtilsTest extends \PHPUnit\Framework\TestCase
49 49
50 /** 50 /**
51 * File not writable: raise an exception. 51 * File not writable: raise an exception.
52 *
53 * @expectedException Shaarli\Exceptions\IOException
54 * @expectedExceptionMessage Error accessing "sandbox/flat.db"
55 */ 52 */
56 public function testWriteWithoutPermission() 53 public function testWriteWithoutPermission()
57 { 54 {
55 $this->expectException(\Shaarli\Exceptions\IOException::class);
56 $this->expectExceptionMessage('Error accessing "sandbox/flat.db"');
57
58 touch(self::$file); 58 touch(self::$file);
59 chmod(self::$file, 0440); 59 chmod(self::$file, 0440);
60 FileUtils::writeFlatDB(self::$file, null); 60 FileUtils::writeFlatDB(self::$file, null);
@@ -62,23 +62,23 @@ class FileUtilsTest extends \PHPUnit\Framework\TestCase
62 62
63 /** 63 /**
64 * Folder non existent: raise an exception. 64 * Folder non existent: raise an exception.
65 *
66 * @expectedException Shaarli\Exceptions\IOException
67 * @expectedExceptionMessage Error accessing "nopefolder"
68 */ 65 */
69 public function testWriteFolderDoesNotExist() 66 public function testWriteFolderDoesNotExist()
70 { 67 {
68 $this->expectException(\Shaarli\Exceptions\IOException::class);
69 $this->expectExceptionMessage('Error accessing "nopefolder"');
70
71 FileUtils::writeFlatDB('nopefolder/file', null); 71 FileUtils::writeFlatDB('nopefolder/file', null);
72 } 72 }
73 73
74 /** 74 /**
75 * Folder non writable: raise an exception. 75 * Folder non writable: raise an exception.
76 *
77 * @expectedException Shaarli\Exceptions\IOException
78 * @expectedExceptionMessage Error accessing "sandbox"
79 */ 76 */
80 public function testWriteFolderPermission() 77 public function testWriteFolderPermission()
81 { 78 {
79 $this->expectException(\Shaarli\Exceptions\IOException::class);
80 $this->expectExceptionMessage('Error accessing "sandbox"');
81
82 chmod(dirname(self::$file), 0555); 82 chmod(dirname(self::$file), 0555);
83 try { 83 try {
84 FileUtils::writeFlatDB(self::$file, null); 84 FileUtils::writeFlatDB(self::$file, null);