Merge pull request #673 from virtualtam/cleanup/linkdb
LinkDB: code cleanup
This commit is contained in:
commit
3d5e0aede3
6 changed files with 88 additions and 88 deletions
tests
|
@ -117,7 +117,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
|
|||
unlink(self::$testDatastore);
|
||||
$this->assertFileNotExists(self::$testDatastore);
|
||||
|
||||
$checkDB = self::getMethod('_checkDB');
|
||||
$checkDB = self::getMethod('check');
|
||||
$checkDB->invokeArgs($linkDB, array());
|
||||
$this->assertFileExists(self::$testDatastore);
|
||||
|
||||
|
@ -134,7 +134,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
|
|||
$datastoreSize = filesize(self::$testDatastore);
|
||||
$this->assertGreaterThan(0, $datastoreSize);
|
||||
|
||||
$checkDB = self::getMethod('_checkDB');
|
||||
$checkDB = self::getMethod('check');
|
||||
$checkDB->invokeArgs($linkDB, array());
|
||||
|
||||
// ensure the datastore is left unmodified
|
||||
|
@ -180,7 +180,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
|
|||
/**
|
||||
* Save the links to the DB
|
||||
*/
|
||||
public function testSaveDB()
|
||||
public function testSave()
|
||||
{
|
||||
$testDB = new LinkDB(self::$testDatastore, true, false);
|
||||
$dbSize = sizeof($testDB);
|
||||
|
@ -194,7 +194,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
|
|||
'tags'=>'unit test'
|
||||
);
|
||||
$testDB[$link['linkdate']] = $link;
|
||||
$testDB->savedb('tests');
|
||||
$testDB->save('tests');
|
||||
|
||||
$testDB = new LinkDB(self::$testDatastore, true, false);
|
||||
$this->assertEquals($dbSize + 1, sizeof($testDB));
|
||||
|
|
|
@ -13,7 +13,7 @@ class ReferenceLinkDB
|
|||
/**
|
||||
* Populates the test DB with reference data
|
||||
*/
|
||||
function __construct()
|
||||
public function __construct()
|
||||
{
|
||||
$this->addLink(
|
||||
'Link title: @website',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue