Skip to content

Commit

Permalink
FIx : KnowledgeRecordTest
Browse files Browse the repository at this point in the history
  • Loading branch information
hystepik committed Dec 6, 2022
1 parent 4b55e39 commit d676dab
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion test/phpunit/KnowledgeRecordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,63 @@ public function testKnowledgeRecordCreate()
return $result;
}

/**
* testKnowledgeRecordFetch
*
* @param int $id Id order
* @return KnowledgeRecord
*
* @depends testKnowledgeRecordCreate
* The depends says test is run only if previous is ok
*/
public function testKnowledgeRecordFetch($id)
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;

$localobject=new KnowledgeRecord($this->savdb);
$result=$localobject->fetch($id);

$this->assertLessThan($result, 0);
print __METHOD__." id=".$id." result=".$result."\n";
return $localobject;
}

/**
* testKnowledgeRecordUpdate
* @param KnowledgeRecord $localobject KnowledgeRecord
* @return int
*
* @depends testKnowledgeRecordFetch
* The depends says test is run only if previous is ok
*/
public function testKnowledgeRecordUpdate($localobject)
{
global $conf, $user, $langs, $db;
$conf = $this->savconf;
$user = $this->savuser;
$langs = $this->savlangs;
$db = $this->savdb;

$localobject->note_private='New note private after update';
$result = $localobject->update($user);

$this->assertLessThan($result, 0);
print __METHOD__." id=".$localobject->id." result=".$result."\n";

return $result;
}

/**
* testKnowledgeRecordDelete
*
* @param int $id Id of object
* @return int
*
* @depends testKnowledgeRecordCreate
* @depends testKnowledgeRecordUpdate
* The depends says test is run only if previous is ok
*/
public function testKnowledgeRecordDelete($id)
Expand Down

0 comments on commit d676dab

Please sign in to comment.