Skip to content

Commit

Permalink
refs vufind-org#2999 adjust test fir getCheckbox: use separate proper…
Browse files Browse the repository at this point in the history
…ty for new html id
  • Loading branch information
RLangeUni committed Apr 18, 2024
1 parent 22e7630 commit cbdedf7
Showing 1 changed file with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,18 +388,26 @@ public function consecutiveCalls(...$args): callable
public function testGetCheckbox()
{
$context = $this->getMockContext();
$context->expects($this->exactly(2))->method('renderInContext')
->with(
self::callback(self::consecutiveCalls(
'record/checkbox.phtml',
['id' => 'bar-Solr|000105196', 'number' => 1, 'prefix' => 'bar', 'formAttr' => 'foo']
)),
self::callback(self::consecutiveCalls(
'record/checkbox.phtml',
['id' => 'bar-Solr|000105196', 'number' => 2, 'prefix' => 'bar', 'formAttr' => 'foo']
))
$context->expects($this->exactly(2))
->method('renderInContext')
->withConsecutive(
['record/checkbox.phtml', $this->callback(function ($array) {
return ($array['number'] ?? null) == 1 &&
($array['id'] ?? '') == 'Solr|000105196' &&
($array['checkboxElementId'] ?? '') == 'bar-Solr|000105196' &&
($array['prefix'] ?? '') == 'bar' &&
($array['formAttr'] ?? '') == 'foo';
})],
['record/checkbox.phtml', $this->callback(function ($array) {
return ($array['number'] ?? null) == 2 &&
($array['id'] ?? '') == 'Solr|000105196' &&
($array['checkboxElementId'] ?? '') == 'bar-Solr|000105196' &&
($array['prefix'] ?? '') == 'bar' &&
($array['formAttr'] ?? '') == 'foo';
})]
)
->willReturnOnConsecutiveCalls('success', 'success');

$record = $this->getRecord(
$this->loadRecordFixture('testbug1.json'),
[],
Expand Down

0 comments on commit cbdedf7

Please sign in to comment.