Merge pull request #23118 from Hystepik/develop#1
Fix : KnowledgeRecordTest add fetch and update
This commit is contained in:
commit
418d7c876e
@ -175,13 +175,63 @@ class KnowledgeRecordTest extends PHPUnit\Framework\TestCase
|
|||||||
return $result;
|
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
|
* testKnowledgeRecordDelete
|
||||||
*
|
*
|
||||||
* @param int $id Id of object
|
* @param int $id Id of object
|
||||||
* @return int
|
* @return int
|
||||||
*
|
*
|
||||||
* @depends testKnowledgeRecordCreate
|
* @depends testKnowledgeRecordUpdate
|
||||||
* The depends says test is run only if previous is ok
|
* The depends says test is run only if previous is ok
|
||||||
*/
|
*/
|
||||||
public function testKnowledgeRecordDelete($id)
|
public function testKnowledgeRecordDelete($id)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user