Skip to content
Permalink
Browse files

Fix up commenting and formatting.

  • Loading branch information...
markstory committed Mar 30, 2018
1 parent e081c01 commit 4323074a668b42ee9bddb8e91aa5fccc5ab4b428
Showing with 7 additions and 7 deletions.
  1. +1 −1 src/Filesystem/File.php
  2. +6 −6 tests/TestCase/Filesystem/FileTest.php
@@ -363,7 +363,7 @@ public function name()
*/
protected static function _basename($path, $ext = null)
{
//check for multibyte string and use basename() if not found
// check for multibyte string and use basename() if not found
if (mb_strlen($path) === strlen($path)) {
return ($ext === null)? basename($path) : basename($path, $ext);
}
@@ -140,6 +140,7 @@ public function testUtf8Filenames()
/**
* Test _basename method
*
* @dataProvider baseNameValueProvider
* @return void
*/
@@ -150,22 +151,21 @@ public function testBasename($path, $suffix, $isRoot)
}
$File = new File($path, false);
//some of paths is directory like '/etc/sudoers.d'
// some paths are directories like '/etc/sudoers.d'
if (!is_dir($path)) {
//test the name after running __construct()
// Check the name after running __construct()
$result = $File->name;
$expecting = basename($path);
$this->assertEquals($expecting, $result);
}
//test the name()
// Check name()
$splInfo = new SplFileInfo($path);
$File->name = ltrim($splInfo->getFilename(), '/\\');
if ($suffix === null) {
$File->info();//to set and unset 'extension' in bellow
if (isset($File->info['extension'])) {
unset($File->info['extension']);
}
unset($File->info['extension']);
$this->assertEquals(basename($path), $File->name());
} else {
$File->info['extension'] = $suffix;

0 comments on commit 4323074

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.