diff options
author | Joas Schilling <coding@schilljs.com> | 2018-01-25 11:23:12 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-01-25 11:33:25 +0100 |
commit | bf2be08c9f3b6957a3327929a169eb6204e84cd0 (patch) | |
tree | 4738ade539309fea85c5db8e796783c2cdbc0438 /tests/lib/AppFramework | |
parent | 24af5c20bd65f8e657bcc495984234088c22e824 (diff) | |
download | nextcloud-server-bf2be08c9f3b6957a3327929a169eb6204e84cd0.tar.gz nextcloud-server-bf2be08c9f3b6957a3327929a169eb6204e84cd0.zip |
Fix risky tests without assertions
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/AppFramework')
3 files changed, 7 insertions, 4 deletions
diff --git a/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php index 2c610736f4a..95729e286f9 100644 --- a/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/PasswordConfirmationMiddlewareTest.php @@ -89,7 +89,7 @@ class PasswordConfirmationMiddlewareTest extends TestCase { /** * @PasswordConfirmationRequired - * @dataProvider testProvider + * @dataProvider dataProvider */ public function testAnnotation($backend, $lastConfirm, $currentTime, $exception) { $this->reflector->reflect(__CLASS__, __FUNCTION__); @@ -116,7 +116,7 @@ class PasswordConfirmationMiddlewareTest extends TestCase { $this->assertSame($exception, $thrown); } - public function testProvider() { + public function dataProvider() { return [ ['foo', 2000, 4000, true], ['foo', 2000, 3000, false], diff --git a/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php index bd1568bcd6b..7784f55e84a 100644 --- a/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/SameSiteCookieMiddlewareTest.php @@ -55,6 +55,7 @@ class SameSiteCookieMiddlewareTest extends TestCase { ->willReturn('/ocs/v2.php'); $this->middleware->beforeController($this->createMock(Controller::class), 'foo'); + $this->addToAssertionCount(1); } public function testBeforeControllerIndexHasAnnotation() { @@ -66,6 +67,7 @@ class SameSiteCookieMiddlewareTest extends TestCase { ->willReturn(true); $this->middleware->beforeController($this->createMock(Controller::class), 'foo'); + $this->addToAssertionCount(1); } public function testBeforeControllerIndexNoAnnotationPassingCheck() { @@ -80,6 +82,7 @@ class SameSiteCookieMiddlewareTest extends TestCase { ->willReturn(true); $this->middleware->beforeController($this->createMock(Controller::class), 'foo'); + $this->addToAssertionCount(1); } public function testBeforeControllerIndexNoAnnotationFailingCheck() { diff --git a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php index 274a2810cba..b68f0cb1981 100644 --- a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php @@ -168,7 +168,7 @@ class SecurityMiddlewareTest extends \Test\TestCase { // add assertion if everything should work fine otherwise phpunit will // complain if ($status === 0) { - $this->assertTrue(true); + $this->addToAssertionCount(1); } } @@ -265,7 +265,7 @@ class SecurityMiddlewareTest extends \Test\TestCase { if($shouldFail) { $this->expectException(SecurityException::class); } else { - $this->assertTrue(true); + $this->addToAssertionCount(1); } $this->reader->reflect(__CLASS__, $method); |