Skip to content
Permalink
Browse files

Add testIsRegisteredStreamWrapper method

  • Loading branch information...
mtak3 committed Jan 24, 2018
1 parent e7dfac4 commit 5d91ab036d4414731239ed9041d95a99874f3f8f
Showing with 19 additions and 0 deletions.
  1. +19 −0 tests/TestCase/Filesystem/FolderTest.php
@@ -1391,4 +1391,23 @@ public function testSortByName()
$this->assertSame(['a.txt', 'b.txt', 'c.txt'], $results);
}
/**
* testIsRegisteredStreamWrapper
*
* @return void
*/
public function testIsRegisteredStreamWrapper()
{
foreach (stream_get_wrappers() as $wrapper) {
$this->assertTrue(Folder::isRegisteredStreamWrapper($wrapper . "://path/to/file"));
$this->assertFalse(Folder::isRegisteredStreamWrapper("bad." . $wrapper . "://path/to/file"));
}
$wrapper = 'unit.test1-';
$this->assertFalse(Folder::isRegisteredStreamWrapper($wrapper . "://path/to/file"));
stream_wrapper_register($wrapper, self::class);
$this->assertTrue(Folder::isRegisteredStreamWrapper($wrapper . "://path/to/file"));
stream_wrapper_unregister($wrapper);
}
}

0 comments on commit 5d91ab0

Please sign in to comment.
You can’t perform that action at this time.