Commit 6cf70df7af696656dccb5e8367db4e6dbe6a82cb

Authored by Neil Blakey-Milner
1 parent 4e0d786a

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,8 +32,14 @@ class DocumentTestCase extends KTUnitTestCase {
32 'metadata' => array(), 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 $oStorage =& KTStorageManagerUtil::getSingleton(); 44 $oStorage =& KTStorageManagerUtil::getSingleton();
39 $sTmpFile = $oStorage->temporaryFile($oDocument); 45 $sTmpFile = $oStorage->temporaryFile($oDocument);
@@ -41,12 +47,18 @@ class DocumentTestCase extends KTUnitTestCase { @@ -41,12 +47,18 @@ class DocumentTestCase extends KTUnitTestCase {
41 $sStoredContents = file_get_contents($sTmpFile); 47 $sStoredContents = file_get_contents($sTmpFile);
42 $oStorage->freeTemporaryFile($sTmpFile); 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 $oDocument =& KTDocumentUtil::add($this->oFolder, "testaddinonego.txt", $this->oUser, array( 55 $oDocument =& KTDocumentUtil::add($this->oFolder, "testaddinonego.txt", $this->oUser, array(
47 'contents' => new KTFSFileLike($sFilename), 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 function testAddSeparately() { 64 function testAddSeparately() {