Skip to content

Commit

Permalink
adds test for new method
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Jul 16, 2024
1 parent b2d72b9 commit 7806cd6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/PHPUnit/Integration/DataAccess/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,27 @@ private function assertAllocatedArchiveId($expectedId)
$this->assertEquals($expectedId, $id);
}

public function testGetAndUpdateArchiveStatus()
{
$this->insertArchiveData([
['date1' => '2020-02-03', 'date2' => '2020-02-03', 'period' => 1, 'name' => 'done', 'value' => ArchiveWriter::DONE_ERROR],
]);

$numericTable = ArchiveTableCreator::getNumericTable(Date::factory('2020-02-03'));

self::assertEquals(
ArchiveWriter::DONE_ERROR,
$this->model->getArchiveStatus($numericTable, '1', 'done')
);

$this->model->updateArchiveStatus($numericTable, '1', 'done', ArchiveWriter::DONE_ERROR_INVALIDATED);

self::assertEquals(
ArchiveWriter::DONE_ERROR_INVALIDATED,
$this->model->getArchiveStatus($numericTable, '1', 'done')
);
}

/**
* @dataProvider getTestDataForHasChildArchivesInPeriod
*/
Expand Down

0 comments on commit 7806cd6

Please sign in to comment.