/**
* @depends testCreateCard
*/
function testGetMultiple()
{
$result = $this->backend->createCard(1, 'card2', 'data2');
$result = $this->backend->createCard(1, 'card3', 'data3');
$check = [['id' => 1, 'uri' => 'card1', 'carddata' => 'card1', 'lastmodified' => 0], ['id' => 2, 'uri' => 'card2', 'carddata' => 'data2', 'lastmodified' => time()], ['id' => 3, 'uri' => 'card3', 'carddata' => 'data3', 'lastmodified' => time()]];
$result = $this->backend->getMultipleCards(1, ['card1', 'card2', 'card3']);
foreach ($check as $index => $node) {
foreach ($node as $k => $v) {
$expected = $v;
$actual = $result[$index][$k];
switch ($k) {
case 'lastmodified':
$this->assertInternalType('int', $actual);
break;
case 'carddata':
if (is_resource($actual)) {
$actual = stream_get_contents($actual);
}
// No break intended.
// No break intended.
default:
$this->assertEquals($expected, $actual);
break;
}
}
}
}