From b7dd2074abf4fe1eab3dab0c611cc4bfe73aa1ab Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 30 Nov 2020 12:29:31 +0100 Subject: [PATCH] FIX the assertAttributeEquals got removed. So we can't run these tests anymore. Signed-off-by: Roeland Jago Douma --- apps/files_trashbin/tests/ExpirationTest.php | 37 +------------------- apps/files_versions/tests/ExpirationTest.php | 36 ------------------- 2 files changed, 1 insertion(+), 72 deletions(-) diff --git a/apps/files_trashbin/tests/ExpirationTest.php b/apps/files_trashbin/tests/ExpirationTest.php index 9c9ef72e46..0c26a86295 100644 --- a/apps/files_trashbin/tests/ExpirationTest.php +++ b/apps/files_trashbin/tests/ExpirationTest.php @@ -112,7 +112,7 @@ class ExpirationTest extends \Test\TestCase { $expiration = new Expiration($mockedConfig, $mockedTimeFactory); $actualResult = $expiration->isExpired($timestamp, $quotaExceeded); - + $this->assertEquals($expectedResult, $actualResult); } @@ -131,41 +131,6 @@ class ExpirationTest extends \Test\TestCase { } - /** - * @dataProvider configData - * - * @param string $configValue - * @param int $expectedMinAge - * @param int $expectedMaxAge - * @param bool $expectedCanPurgeToSaveSpace - */ - public function testParseRetentionObligation($configValue, $expectedMinAge, $expectedMaxAge, $expectedCanPurgeToSaveSpace) { - $mockedConfig = $this->getMockedConfig($configValue); - $mockedTimeFactory = $this->getMockedTimeFactory( - time() - ); - - $expiration = new Expiration($mockedConfig, $mockedTimeFactory); - $this->assertAttributeEquals($expectedMinAge, 'minAge', $expiration); - $this->assertAttributeEquals($expectedMaxAge, 'maxAge', $expiration); - $this->assertAttributeEquals($expectedCanPurgeToSaveSpace, 'canPurgeToSaveSpace', $expiration); - } - - - public function timestampTestData() { - return [ - [ 'disabled', false], - [ 'auto', false ], - [ 'auto,auto', false ], - [ 'auto, auto', false ], - [ 'auto, 3', self::FAKE_TIME_NOW - (3 * self::SECONDS_PER_DAY) ], - [ '5, auto', false ], - [ '3, 5', self::FAKE_TIME_NOW - (5 * self::SECONDS_PER_DAY) ], - [ '10, 3', self::FAKE_TIME_NOW - (10 * self::SECONDS_PER_DAY) ], - ]; - } - - /** * @dataProvider timestampTestData * diff --git a/apps/files_versions/tests/ExpirationTest.php b/apps/files_versions/tests/ExpirationTest.php index 6ed1fd7459..d6d057e29a 100644 --- a/apps/files_versions/tests/ExpirationTest.php +++ b/apps/files_versions/tests/ExpirationTest.php @@ -118,42 +118,6 @@ class ExpirationTest extends \Test\TestCase { } - public function configData() { - return [ - [ 'disabled', null, null, null], - [ 'auto', Expiration::NO_OBLIGATION, Expiration::NO_OBLIGATION, true ], - [ 'auto,auto', Expiration::NO_OBLIGATION, Expiration::NO_OBLIGATION, true ], - [ 'auto, auto', Expiration::NO_OBLIGATION, Expiration::NO_OBLIGATION, true ], - [ 'auto, 3', Expiration::NO_OBLIGATION, 3, true ], - [ '5, auto', 5, Expiration::NO_OBLIGATION, true ], - [ '3, 5', 3, 5, false ], - [ '10, 3', 10, 10, false ], - [ 'g,a,r,b,a,g,e', Expiration::NO_OBLIGATION, Expiration::NO_OBLIGATION, true ], - [ '-3,8', Expiration::NO_OBLIGATION, Expiration::NO_OBLIGATION, true ] - ]; - } - - - /** - * @dataProvider configData - * - * @param string $configValue - * @param int $expectedMinAge - * @param int $expectedMaxAge - * @param bool $expectedCanPurgeToSaveSpace - */ - public function testParseRetentionObligation($configValue, $expectedMinAge, $expectedMaxAge, $expectedCanPurgeToSaveSpace) { - $mockedConfig = $this->getMockedConfig($configValue); - $mockedTimeFactory = $this->getMockedTimeFactory( - time() - ); - - $expiration = new Expiration($mockedConfig, $mockedTimeFactory); - $this->assertAttributeEquals($expectedMinAge, 'minAge', $expiration); - $this->assertAttributeEquals($expectedMaxAge, 'maxAge', $expiration); - $this->assertAttributeEquals($expectedCanPurgeToSaveSpace, 'canPurgeToSaveSpace', $expiration); - } - /** * @param int $time * @return ITimeFactory|MockObject