mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-12 15:21:40 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6001 201d5d3c-b55e-5fd7-737f-ddc643e51545
19 lines
832 B
PHP
19 lines
832 B
PHP
<?php
|
|
class LockTest extends UnitTestCase {
|
|
function testLock() {
|
|
$oController = &getController('module');
|
|
$this->assertNotNull($oController);
|
|
$output = $oController->lock('lockTest', 60);
|
|
$this->assertTrue($output->toBool());
|
|
$deadline = $output->get('deadline');
|
|
$output2 = $oController->lock('lockTest', 60);
|
|
$this->assertFalse($output2->toBool());
|
|
$output2 = $oController->unlock('lockTest', $deadline);
|
|
$this->assertTrue($output2->toBool());
|
|
$output2 = $oController->lock('lockTest', 60);
|
|
$this->assertTrue($output2->toBool());
|
|
$output2 = $oController->unlock('lockTest', $output2->get('deadline'));
|
|
$this->assertTrue($output2->toBool());
|
|
}
|
|
}
|
|
?>
|