Skip to content

Commit

Permalink
Update test to be more useful
Browse files Browse the repository at this point in the history
  • Loading branch information
skarya22 committed Dec 3, 2024
1 parent 4d5e670 commit 6fa5e09
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/unittests/NDB_PageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function testAddBasicTextArea()
/**
* Test that addBasicDate calls addElement from LorisForm and properly adds
* an element to the page's form when dateOptions is not set. Since
* dateOptions is not set, the options array should remain empty.
* dateOptions is not set, the options array should just have the default maxYear.
*
* @covers NDB_Page::addBasicDate
* @return void
Expand All @@ -267,14 +267,17 @@ public function testAddBasicDateWithNoDateOptions()
/**
* Test that addBasicDate calls addElement from LorisForm and properly adds
* an element to the page's form when dateOptions is set. Since
* dateOptions is set, the options array should have information in it.
* dateOptions is set, the options array should have that information in it
*
* @covers NDB_Page::addBasicDate
* @return void
*/
public function testAddBasicDateWithDateOptionsSet()
{
$this->_page->dateOptions = ['someOption' => 'true'];
$this->_page->dateOptions = [
'someOption' => 'true',
'maxYear' => '2028'
];
$this->_page->addBasicDate("test_name", "test_label");
$this->assertEquals(
['name' => 'test_name',
Expand All @@ -283,7 +286,7 @@ public function testAddBasicDateWithDateOptionsSet()
'class' => 'form-control input-sm',
'options' => [
'someOption' => 'true',
'maxYear' => '9999'
'maxYear' => '2028'
]
],
$this->_page->form->form['test_name']
Expand Down

0 comments on commit 6fa5e09

Please sign in to comment.