]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't clean up the test environment if a data provider was finished
authorBjoern Schiessle <schiessle@owncloud.com>
Wed, 13 Aug 2014 09:41:11 +0000 (11:41 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Wed, 13 Aug 2014 09:41:11 +0000 (11:41 +0200)
tests/testcleanuplistener.php

index 8a9e9e6efbfbd641b3590e102bdb217ee2bb0583..7b442bbd4f79e9962774e7a22505869fe6dbe203 100644 (file)
@@ -41,20 +41,23 @@ class TestCleanupListener implements PHPUnit_Framework_TestListener {
        }
 
        public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {
-               if ($this->cleanStorages() && $this->isShowSuiteWarning()) {
-                       printf("TestSuite '%s': Did not clean up storages\n", $suite->getName());
-               }
-               if ($this->cleanFileCache() && $this->isShowSuiteWarning()) {
-                       printf("TestSuite '%s': Did not clean up file cache\n", $suite->getName());
-               }
-               if ($this->cleanStrayDataFiles() && $this->isShowSuiteWarning()) {
-                       printf("TestSuite '%s': Did not clean up data dir\n", $suite->getName());
-               }
-               if ($this->cleanStrayHooks() && $this->isShowSuiteWarning()) {
-                       printf("TestSuite '%s': Did not clean up hooks\n", $suite->getName());
-               }
-               if ($this->cleanProxies() && $this->isShowSuiteWarning()) {
-                       printf("TestSuite '%s': Did not clean up proxies\n", $suite->getName());
+               // don't clean up the test environment if a data provider finished
+               if (!($suite instanceof PHPUnit_Framework_TestSuite_DataProvider)) {
+                       if ($this->cleanStorages() && $this->isShowSuiteWarning()) {
+                               printf("TestSuite '%s': Did not clean up storages\n", $suite->getName());
+                       }
+                       if ($this->cleanFileCache() && $this->isShowSuiteWarning()) {
+                               printf("TestSuite '%s': Did not clean up file cache\n", $suite->getName());
+                       }
+                       if ($this->cleanStrayDataFiles() && $this->isShowSuiteWarning()) {
+                               printf("TestSuite '%s': Did not clean up data dir\n", $suite->getName());
+                       }
+                       if ($this->cleanStrayHooks() && $this->isShowSuiteWarning()) {
+                               printf("TestSuite '%s': Did not clean up hooks\n", $suite->getName());
+                       }
+                       if ($this->cleanProxies() && $this->isShowSuiteWarning()) {
+                               printf("TestSuite '%s': Did not clean up proxies\n", $suite->getName());
+                       }
                }
        }