Commit 3754a95709a0a9e8a58873a1e08083bd74566fe0

Authored by nbm
1 parent 00836246

Don't continue with tests if one of the asserts fail.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6023 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 16 additions and 4 deletions
tests/document/testDocument.php
... ... @@ -32,8 +32,14 @@ class DocumentTestCase extends KTUnitTestCase {
32 32 'metadata' => array(),
33 33 ));
34 34  
35   - $this->assertEntity($oDocument, 'Document');
36   - $this->assertEqual($oDocument->getStatusId(), 1);
  35 + $res = $this->assertEntity($oDocument, 'Document');
  36 + if ($res === false) {
  37 + return;
  38 + }
  39 + $res = $this->assertEqual($oDocument->getStatusId(), 1);
  40 + if ($res === false) {
  41 + return;
  42 + }
37 43  
38 44 $oStorage =& KTStorageManagerUtil::getSingleton();
39 45 $sTmpFile = $oStorage->temporaryFile($oDocument);
... ... @@ -41,12 +47,18 @@ class DocumentTestCase extends KTUnitTestCase {
41 47 $sStoredContents = file_get_contents($sTmpFile);
42 48 $oStorage->freeTemporaryFile($sTmpFile);
43 49  
44   - $this->assertEqual($sLocalContents, $sStoredContents);
  50 + $res = $this->assertEqual($sLocalContents, $sStoredContents);
  51 + if ($res === false) {
  52 + return;
  53 + }
45 54  
46 55 $oDocument =& KTDocumentUtil::add($this->oFolder, "testaddinonego.txt", $this->oUser, array(
47 56 'contents' => new KTFSFileLike($sFilename),
48 57 ));
49   - $this->assertEntity($oDocument, 'PEAR_Error');
  58 + $res = $this->assertEntity($oDocument, 'PEAR_Error');
  59 + if ($res === false) {
  60 + return;
  61 + }
50 62 }
51 63  
52 64 function testAddSeparately() {
... ...