Skip to content

Commit

Permalink
FIX
Browse files Browse the repository at this point in the history
the assertAttributeEquals got removed.
So we can't run these tests anymore.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed Dec 7, 2020
1 parent 673beef commit b7dd207
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 72 deletions.
37 changes: 1 addition & 36 deletions apps/files_trashbin/tests/ExpirationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function testExpiration($retentionObligation, $timeNow, $timestamp, $quot

$expiration = new Expiration($mockedConfig, $mockedTimeFactory);
$actualResult = $expiration->isExpired($timestamp, $quotaExceeded);

$this->assertEquals($expectedResult, $actualResult);
}

Expand All @@ -131,41 +131,6 @@ public function configData() {
}


/**
* @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() {

This comment has been minimized.

Copy link
@nickvergessen

nickvergessen Apr 20, 2021

Member

opsy, fixing this

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
*
Expand Down
36 changes: 0 additions & 36 deletions apps/files_versions/tests/ExpirationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,42 +118,6 @@ public function testExpiration($retentionObligation, $timeNow, $timestamp, $quot
}


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
Expand Down

0 comments on commit b7dd207

Please sign in to comment.