PHP Classes

File: tests/NinjaMutex/MutexTest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Kamil Dziedzic  >  Ninja Mutex  >  tests/NinjaMutex/MutexTest.php  >  Download  
File: tests/NinjaMutex/MutexTest.php
Role: Unit test script
Content type: text/plain
Description: Test
Class: Ninja Mutex
Lock resources to prevent simultaneous accesses
Author: By
Last change: Merge branch 'master' into hhvm
Date: 11 months ago
Size: 1,524 bytes


Class file image Download
 * This file is part of ninja-mutex.
 * (C) Kamil Dziedzic <>
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
namespace NinjaMutex;


 * Tests for Mutex
 * @author Kamil Dziedzic <>
class MutexTest extends \PHPUnit_Framework_TestCase
     * @issue
public function testIfMutexDestructorThrowsWhenBackendIsUnavailable()
$lockImplementor = new MockLock();
$mutex = new Mutex('forfiter', $lockImplementor);


// make backend unavailable

        try {
// explicit __destructor() call, should throw UnrecoverableMutexException
        } catch (
UnrecoverableMutexException $e) {
// make backend available again
// release lock


$this->fail('An expected exception has not been raised.');