From bf2be08c9f3b6957a3327929a169eb6204e84cd0 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 25 Jan 2018 11:23:12 +0100 Subject: Fix risky tests without assertions Signed-off-by: Joas Schilling --- apps/dav/tests/unit/AppInfo/ApplicationTest.php | 2 +- apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php | 4 ++-- apps/dav/tests/unit/CalDAV/CalendarTest.php | 2 +- apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php | 2 +- apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php | 2 +- apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php | 2 ++ 6 files changed, 8 insertions(+), 6 deletions(-) (limited to 'apps/dav') diff --git a/apps/dav/tests/unit/AppInfo/ApplicationTest.php b/apps/dav/tests/unit/AppInfo/ApplicationTest.php index bb6cfe67b4d..d4f53d360a9 100644 --- a/apps/dav/tests/unit/AppInfo/ApplicationTest.php +++ b/apps/dav/tests/unit/AppInfo/ApplicationTest.php @@ -61,6 +61,6 @@ class ApplicationTest extends TestCase { /** @var IManager|\PHPUnit_Framework_MockObject_MockObject $cm */ $cm = $this->createMock(IManager::class); $app->setupContactsProvider($cm, 'xxx'); - $this->assertTrue(true); + $this->addToAssertionCount(1); } } diff --git a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php index 2a01bd425c0..310433f0913 100644 --- a/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php +++ b/apps/dav/tests/unit/CalDAV/AbstractCalDavBackend.php @@ -176,7 +176,7 @@ EOD; protected function assertAcl($principal, $privilege, $acl) { foreach($acl as $a) { if ($a['principal'] === $principal && $a['privilege'] === $privilege) { - $this->assertTrue(true); + $this->addToAssertionCount(1); return; } } @@ -190,7 +190,7 @@ EOD; return; } } - $this->assertTrue(true); + $this->addToAssertionCount(1); } protected function assertAccess($shouldHaveAcl, $principal, $privilege, $acl) { diff --git a/apps/dav/tests/unit/CalDAV/CalendarTest.php b/apps/dav/tests/unit/CalDAV/CalendarTest.php index dbdbf0dbafd..f467d46bf60 100644 --- a/apps/dav/tests/unit/CalDAV/CalendarTest.php +++ b/apps/dav/tests/unit/CalDAV/CalendarTest.php @@ -183,7 +183,7 @@ class CalendarTest extends TestCase { ->with(666, $propPatch); } $c->propPatch($propPatch); - $this->assertTrue(true); + $this->addToAssertionCount(1); } /** diff --git a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php index cbde8c2ef68..91973eeff5d 100644 --- a/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/CustomPropertiesBackendTest.php @@ -174,7 +174,7 @@ class CustomPropertiesBackendTest extends \Test\TestCase { ); // no exception, soft fail - $this->assertTrue(true); + $this->addToAssertionCount(1); } /** diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php index e72987ef02d..968cb548068 100644 --- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php @@ -345,7 +345,7 @@ class DirectoryTest extends \Test\TestCase { */ public function testMoveSuccess($source, $destination, $updatables, $deletables) { $this->moveTest($source, $destination, $updatables, $deletables); - $this->assertTrue(true); + $this->addToAssertionCount(1); } /** diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php index e1c4bc05dc1..ea520bca7e5 100644 --- a/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/FilesPluginTest.php @@ -383,6 +383,8 @@ class FilesPluginTest extends TestCase { $propFind, $node ); + + $this->addToAssertionCount(1); } public function testUpdateProps() { -- cgit v1.2.3