Skip to content

Commit 2d76a1b

Browse files
committed
add test for new method
1 parent 8349fe6 commit 2d76a1b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/PHPUnit/Integration/DataAccess/ModelTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,23 @@ public function testDeleteInvalidationsForDeletedSites()
693693
], $invalidations);
694694
}
695695

696+
public function testGetInvalidationsInProgress()
697+
{
698+
$this->insertInvalidations([
699+
['idsite' => 1, 'date1' => '2014-02-01', 'date2' => '2014-02-28', 'period' => 2, 'name' => 'done'],
700+
['idsite' => 1, 'date1' => '2014-02-01', 'date2' => '2014-02-01', 'period' => 1, 'name' => 'doneb321434abb5a139c17dadf08c9d2e315', 'ts_started' => '2014-02-03 23:13:00', 'status' => 1],
701+
['idsite' => 1, 'date1' => '2014-02-03', 'date2' => '2014-02-03', 'period' => 1, 'name' => 'done', 'ts_started' => '2014-02-03 23:00:00', 'status' => 1],
702+
['idsite' => 1, 'date1' => '2014-02-01', 'date2' => '2014-02-01', 'period' => 1, 'name' => 'done'],
703+
]);
704+
705+
$expectedInvalidations = [
706+
['idsite' => 1, 'date1' => '2014-02-03', 'date2' => '2014-02-03', 'period' => 1, 'name' => 'done', 'ts_started' => '2014-02-03 23:00:00'],
707+
['idsite' => 1, 'date1' => '2014-02-01', 'date2' => '2014-02-01', 'period' => 1, 'name' => 'doneb321434abb5a139c17dadf08c9d2e315', 'ts_started' => '2014-02-03 23:13:00'],
708+
];
709+
710+
self::assertEquals($expectedInvalidations, $this->model->getInvalidationsInProgress(1));
711+
}
712+
696713
private function insertArchiveData($archivesToInsert)
697714
{
698715
$idarchive = 1;

0 commit comments

Comments
 (0)