Skip to content

Commit 00f360d

Browse files
committed
Use PHPunit assertion
1 parent 9935d12 commit 00f360d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Tests/FilesystemTest.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function testCopyCreatesTargetDirectoryIfItDoesNotExist()
153153

154154
$this->filesystem->copy($sourceFilePath, $targetFilePath);
155155

156-
$this->assertTrue(is_dir($targetFileDirectory));
156+
$this->assertDirectoryExists($targetFileDirectory);
157157
$this->assertFileExists($targetFilePath);
158158
$this->assertStringEqualsFile($targetFilePath, 'SOURCE FILE');
159159
}
@@ -185,7 +185,7 @@ public function testMkdirCreatesDirectoriesRecursively()
185185

186186
$this->filesystem->mkdir($directory);
187187

188-
$this->assertTrue(is_dir($directory));
188+
$this->assertDirectoryExists($directory);
189189
}
190190

191191
public function testMkdirCreatesDirectoriesFromArray()
@@ -197,9 +197,9 @@ public function testMkdirCreatesDirectoriesFromArray()
197197

198198
$this->filesystem->mkdir($directories);
199199

200-
$this->assertTrue(is_dir($basePath.'1'));
201-
$this->assertTrue(is_dir($basePath.'2'));
202-
$this->assertTrue(is_dir($basePath.'3'));
200+
$this->assertDirectoryExists($basePath.'1');
201+
$this->assertDirectoryExists($basePath.'2');
202+
$this->assertDirectoryExists($basePath.'3');
203203
}
204204

205205
public function testMkdirCreatesDirectoriesFromTraversableObject()
@@ -211,9 +211,9 @@ public function testMkdirCreatesDirectoriesFromTraversableObject()
211211

212212
$this->filesystem->mkdir($directories);
213213

214-
$this->assertTrue(is_dir($basePath.'1'));
215-
$this->assertTrue(is_dir($basePath.'2'));
216-
$this->assertTrue(is_dir($basePath.'3'));
214+
$this->assertDirectoryExists($basePath.'1');
215+
$this->assertDirectoryExists($basePath.'2');
216+
$this->assertDirectoryExists($basePath.'3');
217217
}
218218

219219
public function testMkdirCreatesDirectoriesFails()
@@ -347,7 +347,7 @@ public function testRemoveCleansInvalidLinks()
347347

348348
// create symlink to dir using trailing forward slash
349349
$this->filesystem->symlink($basePath.'dir/', $basePath.'dir-link');
350-
$this->assertTrue(is_dir($basePath.'dir-link'));
350+
$this->assertDirectoryExists($basePath.'dir-link');
351351

352352
// create symlink to nonexistent dir
353353
rmdir($basePath.'dir');
@@ -825,7 +825,7 @@ public function testRemoveSymlink()
825825

826826
$this->assertFalse(is_link($link));
827827
$this->assertFalse(is_file($link));
828-
$this->assertFalse(is_dir($link));
828+
$this->assertDirectoryNotExists($link);
829829
}
830830

831831
public function testSymlinkIsOverwrittenIfPointsToDifferentTarget()
@@ -1170,8 +1170,8 @@ public function testMirrorCopiesFilesAndDirectoriesRecursively()
11701170

11711171
$this->filesystem->mirror($sourcePath, $targetPath);
11721172

1173-
$this->assertTrue(is_dir($targetPath));
1174-
$this->assertTrue(is_dir($targetPath.'directory'));
1173+
$this->assertDirectoryExists($targetPath);
1174+
$this->assertDirectoryExists($targetPath.'directory');
11751175
$this->assertFileEquals($file1, $targetPath.'directory'.\DIRECTORY_SEPARATOR.'file1');
11761176
$this->assertFileEquals($file2, $targetPath.'file2');
11771177

@@ -1204,7 +1204,7 @@ public function testMirrorCreatesEmptyDirectory()
12041204

12051205
$this->filesystem->mirror($sourcePath, $targetPath);
12061206

1207-
$this->assertTrue(is_dir($targetPath));
1207+
$this->assertDirectoryExists($targetPath);
12081208

12091209
$this->filesystem->remove($sourcePath);
12101210
}
@@ -1223,7 +1223,7 @@ public function testMirrorCopiesLinks()
12231223

12241224
$this->filesystem->mirror($sourcePath, $targetPath);
12251225

1226-
$this->assertTrue(is_dir($targetPath));
1226+
$this->assertDirectoryExists($targetPath);
12271227
$this->assertFileEquals($sourcePath.'file1', $targetPath.'link1');
12281228
$this->assertTrue(is_link($targetPath.\DIRECTORY_SEPARATOR.'link1'));
12291229
}
@@ -1243,7 +1243,7 @@ public function testMirrorCopiesLinkedDirectoryContents()
12431243

12441244
$this->filesystem->mirror($sourcePath, $targetPath);
12451245

1246-
$this->assertTrue(is_dir($targetPath));
1246+
$this->assertDirectoryExists($targetPath);
12471247
$this->assertFileEquals($sourcePath.'/nested/file1.txt', $targetPath.'link1/file1.txt');
12481248
$this->assertTrue(is_link($targetPath.\DIRECTORY_SEPARATOR.'link1'));
12491249
}
@@ -1267,7 +1267,7 @@ public function testMirrorCopiesRelativeLinkedContents()
12671267

12681268
$this->filesystem->mirror($sourcePath, $targetPath);
12691269

1270-
$this->assertTrue(is_dir($targetPath));
1270+
$this->assertDirectoryExists($targetPath);
12711271
$this->assertFileEquals($sourcePath.'/nested/file1.txt', $targetPath.'link1/file1.txt');
12721272
$this->assertTrue(is_link($targetPath.\DIRECTORY_SEPARATOR.'link1'));
12731273
$this->assertEquals('\\' === \DIRECTORY_SEPARATOR ? realpath($sourcePath.'\nested') : 'nested', readlink($targetPath.\DIRECTORY_SEPARATOR.'link1'));
@@ -1290,7 +1290,7 @@ public function testMirrorContentsWithSameNameAsSourceOrTargetWithoutDeleteOptio
12901290

12911291
chdir($oldPath);
12921292

1293-
$this->assertTrue(is_dir($targetPath));
1293+
$this->assertDirectoryExists($targetPath);
12941294
$this->assertFileExists($targetPath.'source');
12951295
$this->assertFileExists($targetPath.'target');
12961296
}
@@ -1315,7 +1315,7 @@ public function testMirrorContentsWithSameNameAsSourceOrTargetWithDeleteOption()
13151315

13161316
chdir($oldPath);
13171317

1318-
$this->assertTrue(is_dir($targetPath));
1318+
$this->assertDirectoryExists($targetPath);
13191319
$this->assertFileExists($targetPath.'source');
13201320
$this->assertFileNotExists($targetPath.'target');
13211321
}

0 commit comments

Comments
 (0)