mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08:00
actually use local variable (for Codacy)
This commit is contained in:
parent
d367655c6d
commit
7d1dc55a27
|
@ -236,16 +236,16 @@ class modelTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertTrue($store->exists($ids[$key]), "paste $key exists after storing it");
|
||||
}
|
||||
$this->_model->purge(10);
|
||||
foreach (array_keys($ids) as $key)
|
||||
foreach ($ids as $key => $id)
|
||||
{
|
||||
if (in_array($key, array('x', 'y', 'z')))
|
||||
{
|
||||
$this->assertTrue($this->_model->getPaste($ids[$key])->exists(), "paste $key exists after purge");
|
||||
$this->_model->getPaste($ids[$key])->delete();
|
||||
$this->assertTrue($this->_model->getPaste($id)->exists(), "paste $key exists after purge");
|
||||
$this->_model->getPaste($id)->delete();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->assertFalse($this->_model->getPaste($ids[$key])->exists(), "paste $key was purged");
|
||||
$this->assertFalse($this->_model->getPaste($id)->exists(), "paste $key was purged");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,11 +89,12 @@ class privatebin_dataTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
if (in_array($key, array('x', 'y', 'z')))
|
||||
{
|
||||
$this->assertTrue($this->_model->exists($ids[$key]), "paste $key exists after purge");
|
||||
$this->assertTrue($this->_model->exists($id), "paste $key exists after purge");
|
||||
$this->_model->delete($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->assertFalse($this->_model->exists($ids[$key]), "paste $key was purged");
|
||||
$this->assertFalse($this->_model->exists($id), "paste $key was purged");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,12 +95,12 @@ class privatebin_dbTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
if (in_array($key, array('x', 'y', 'z')))
|
||||
{
|
||||
$this->assertTrue($this->_model->exists($ids[$key]), "paste $key exists after purge");
|
||||
$this->_model->delete($ids[$key]);
|
||||
$this->assertTrue($this->_model->exists($id), "paste $key exists after purge");
|
||||
$this->_model->delete($id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->assertFalse($this->_model->exists($ids[$key]), "paste $key was purged");
|
||||
$this->assertFalse($this->_model->exists($id), "paste $key was purged");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user