Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] skip tests using stream_lock when running on hhvm #82

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/test/php/org/bovigo/vfs/vfsStreamExLockTestCase.php
Expand Up @@ -35,6 +35,10 @@ protected function setUp()
*/
public function filePutContentsLockShouldReportError()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in hhvm.');
}
@file_put_contents(vfsStream::url('root/testfile'), "some string\n", LOCK_EX);
$php_error = error_get_last();
$this->assertEquals("file_put_contents(): Exclusive locks may only be set for regular files", $php_error['message']);
Expand Down
52 changes: 52 additions & 0 deletions src/test/php/org/bovigo/vfs/vfsStreamWrapperFlockTestCase.php
Expand Up @@ -114,6 +114,10 @@ public function canAquireEclusiveLockWithNonBlockingFlockCall()
*/
public function canRemoveLock()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp = fopen(vfsStream::url('root/foo.txt'), 'rb');
$file->lock($fp, LOCK_EX);
Expand Down Expand Up @@ -149,6 +153,10 @@ public function canRemoveLockWhenNotLocked()
*/
public function canRemoveSharedLockWithoutRemovingSharedLockOnOtherFileHandler()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb');
$fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb');
Expand Down Expand Up @@ -205,6 +213,10 @@ public function canNotRemoveExlusiveLockAcquiredOnOtherFileHandler()
*/
public function canRemoveLockWithNonBlockingFlockCall()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp = fopen(vfsStream::url('root/foo.txt'), 'rb');
$file->lock($fp, LOCK_EX);
Expand All @@ -222,6 +234,10 @@ public function canRemoveLockWithNonBlockingFlockCall()
*/
public function canNotAquireExclusiveLockIfAlreadyExclusivelyLockedOnOtherFileHandler()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb');
$fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb');
Expand All @@ -243,6 +259,10 @@ public function canNotAquireExclusiveLockIfAlreadyExclusivelyLockedOnOtherFileHa
*/
public function canAquireExclusiveLockIfAlreadySelfExclusivelyLocked()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp = fopen(vfsStream::url('root/foo.txt'), 'rb');
$file->lock($fp, LOCK_EX);
Expand All @@ -260,6 +280,10 @@ public function canAquireExclusiveLockIfAlreadySelfExclusivelyLocked()
*/
public function canNotAquireExclusiveLockIfAlreadySharedLockedOnOtherFileHandler()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb');
$fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb');
Expand All @@ -279,6 +303,10 @@ public function canNotAquireExclusiveLockIfAlreadySharedLockedOnOtherFileHandler
*/
public function canAquireExclusiveLockIfAlreadySelfSharedLocked()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp = fopen(vfsStream::url('root/foo.txt'), 'rb');
$file->lock($fp, LOCK_SH);
Expand Down Expand Up @@ -315,6 +343,10 @@ public function canNotAquireSharedLockIfAlreadyExclusivelyLockedOnOtherFileHandl
*/
public function canAquireSharedLockIfAlreadySelfExclusivelyLocked()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp = fopen(vfsStream::url('root/foo.txt'), 'rb');
$file->lock($fp, LOCK_EX);
Expand Down Expand Up @@ -349,6 +381,10 @@ public function canAquireSharedLockIfAlreadySelfSharedLocked()
*/
public function canAquireSharedLockIfAlreadySharedLockedOnOtherFileHandler()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb');
$fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb');
Expand All @@ -372,6 +408,10 @@ public function canAquireSharedLockIfAlreadySharedLockedOnOtherFileHandler()
*/
public function removesExclusiveLockOnStreamClose()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp = fopen(vfsStream::url('root/foo.txt'), 'rb');
$file->lock($fp, LOCK_EX);
Expand All @@ -390,6 +430,10 @@ public function removesExclusiveLockOnStreamClose()
*/
public function removesSharedLockOnStreamClose()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp = fopen(vfsStream::url('root/foo.txt'), 'rb');
$file->lock($fp, LOCK_SH);
Expand All @@ -406,6 +450,10 @@ public function removesSharedLockOnStreamClose()
*/
public function notRemovesExclusiveLockOnStreamCloseIfExclusiveLockAcquiredOnOtherFileHandler()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb');
$fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb');
Expand All @@ -425,6 +473,10 @@ public function notRemovesExclusiveLockOnStreamCloseIfExclusiveLockAcquiredOnOth
*/
public function notRemovesSharedLockOnStreamCloseIfSharedLockAcquiredOnOtherFileHandler()
{
// http://docs.hhvm.com/manual/en/streamwrapper.stream-lock.php
if (strstr(PHP_VERSION, 'hiphop') !== false) {
$this->markTestSkipped('streamWrapper::stream_lock is not supported in HHVM.');
}
$file = vfsStream::newFile('foo.txt')->at($this->root);
$fp1 = fopen(vfsStream::url('root/foo.txt'), 'rb');
$fp2 = fopen(vfsStream::url('root/foo.txt'), 'rb');
Expand Down