From 3754a95709a0a9e8a58873a1e08083bd74566fe0 Mon Sep 17 00:00:00 2001 From: nbm Date: Wed, 18 Oct 2006 07:28:23 +0000 Subject: [PATCH] Don't continue with tests if one of the asserts fail. --- tests/document/testDocument.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/document/testDocument.php b/tests/document/testDocument.php index cad478c..eabd4b5 100644 --- a/tests/document/testDocument.php +++ b/tests/document/testDocument.php @@ -32,8 +32,14 @@ class DocumentTestCase extends KTUnitTestCase { 'metadata' => array(), )); - $this->assertEntity($oDocument, 'Document'); - $this->assertEqual($oDocument->getStatusId(), 1); + $res = $this->assertEntity($oDocument, 'Document'); + if ($res === false) { + return; + } + $res = $this->assertEqual($oDocument->getStatusId(), 1); + if ($res === false) { + return; + } $oStorage =& KTStorageManagerUtil::getSingleton(); $sTmpFile = $oStorage->temporaryFile($oDocument); @@ -41,12 +47,18 @@ class DocumentTestCase extends KTUnitTestCase { $sStoredContents = file_get_contents($sTmpFile); $oStorage->freeTemporaryFile($sTmpFile); - $this->assertEqual($sLocalContents, $sStoredContents); + $res = $this->assertEqual($sLocalContents, $sStoredContents); + if ($res === false) { + return; + } $oDocument =& KTDocumentUtil::add($this->oFolder, "testaddinonego.txt", $this->oUser, array( 'contents' => new KTFSFileLike($sFilename), )); - $this->assertEntity($oDocument, 'PEAR_Error'); + $res = $this->assertEntity($oDocument, 'PEAR_Error'); + if ($res === false) { + return; + } } function testAddSeparately() { -- libgit2 0.21.4