mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-20 07:21:30 +02:00
[ticket/11700] Move all recent code to namespaces
PHPBB3-11700
This commit is contained in:
@@ -25,9 +25,9 @@ class phpbb_lock_db_test extends phpbb_database_test_case
|
||||
global $db, $config;
|
||||
|
||||
$db = $this->db = $this->new_dbal();
|
||||
$config = $this->config = new phpbb_config(array('rand_seed' => '', 'rand_seed_last_update' => '0'));
|
||||
$config = $this->config = new \phpbb\config\config(array('rand_seed' => '', 'rand_seed_last_update' => '0'));
|
||||
set_config(null, null, null, $this->config);
|
||||
$this->lock = new phpbb_lock_db('test_lock', $this->config, $this->db);
|
||||
$this->lock = new \phpbb\lock\db('test_lock', $this->config, $this->db);
|
||||
}
|
||||
|
||||
public function test_new_lock()
|
||||
@@ -38,7 +38,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case
|
||||
$this->assertTrue($this->lock->owns_lock());
|
||||
$this->assertTrue(isset($this->config['test_lock']), 'Lock was created');
|
||||
|
||||
$lock2 = new phpbb_lock_db('test_lock', $this->config, $this->db);
|
||||
$lock2 = new \phpbb\lock\db('test_lock', $this->config, $this->db);
|
||||
$this->assertFalse($lock2->acquire());
|
||||
$this->assertFalse($lock2->owns_lock());
|
||||
|
||||
@@ -49,7 +49,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case
|
||||
|
||||
public function test_expire_lock()
|
||||
{
|
||||
$lock = new phpbb_lock_db('foo_lock', $this->config, $this->db);
|
||||
$lock = new \phpbb\lock\db('foo_lock', $this->config, $this->db);
|
||||
$this->assertTrue($lock->acquire());
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case
|
||||
$this->assertFalse($this->lock->owns_lock());
|
||||
$this->assertEquals('0', $this->config['test_lock'], 'First lock is released');
|
||||
|
||||
$lock2 = new phpbb_lock_db('test_lock', $this->config, $this->db);
|
||||
$lock2 = new \phpbb\lock\db('test_lock', $this->config, $this->db);
|
||||
$this->assertTrue($lock2->acquire());
|
||||
$this->assertTrue($lock2->owns_lock());
|
||||
$this->assertFalse(empty($this->config['test_lock']), 'Second lock is acquired');
|
||||
|
@@ -13,7 +13,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
|
||||
{
|
||||
$path = __DIR__ . '/../tmp/precious';
|
||||
|
||||
$lock = new phpbb_lock_flock($path);
|
||||
$lock = new \phpbb\lock\flock($path);
|
||||
$ok = $lock->acquire();
|
||||
$this->assertTrue($ok);
|
||||
$lock->release();
|
||||
@@ -23,7 +23,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
|
||||
{
|
||||
$path = __DIR__ . '/../tmp/precious';
|
||||
|
||||
$lock = new phpbb_lock_flock($path);
|
||||
$lock = new \phpbb\lock\flock($path);
|
||||
$ok = $lock->acquire();
|
||||
$this->assertTrue($ok);
|
||||
$this->assertTrue($lock->owns_lock());
|
||||
@@ -48,11 +48,11 @@ class phpbb_lock_flock_test extends phpbb_test_case
|
||||
{
|
||||
$path = __DIR__ . '/../tmp/precious';
|
||||
|
||||
$lock1 = new phpbb_lock_flock($path);
|
||||
$lock1 = new \phpbb\lock\flock($path);
|
||||
$ok = $lock1->acquire();
|
||||
$this->assertTrue($ok);
|
||||
|
||||
$lock2 = new phpbb_lock_flock($path);
|
||||
$lock2 = new \phpbb\lock\flock($path);
|
||||
$ok = $lock2->acquire();
|
||||
$this->assertFalse($ok);
|
||||
|
||||
@@ -78,7 +78,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
|
||||
// wait 0.5 s, acquire the lock, note how long it took
|
||||
sleep(1);
|
||||
|
||||
$lock = new phpbb_lock_flock($path);
|
||||
$lock = new \phpbb\lock\flock($path);
|
||||
$start = time();
|
||||
$ok = $lock->acquire();
|
||||
$delta = time() - $start;
|
||||
@@ -105,7 +105,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
|
||||
{
|
||||
// child
|
||||
// immediately acquire the lock and sleep for 2 s
|
||||
$lock = new phpbb_lock_flock($path);
|
||||
$lock = new \phpbb\lock\flock($path);
|
||||
$ok = $lock->acquire();
|
||||
$this->assertTrue($ok);
|
||||
$this->assertTrue($lock->owns_lock());
|
||||
|
Reference in New Issue
Block a user