1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-30 21:30:14 +02:00

refactor/fix (#3924)

This commit is contained in:
Dag
2024-01-25 13:03:00 +01:00
committed by GitHub
parent 06b299e627
commit 9574c17ddc
9 changed files with 153 additions and 178 deletions

View File

@@ -30,12 +30,12 @@ class BridgeCardTest extends TestCase
'defaultValue' => 'yo1',
'exampleValue' => 'yo2',
];
$this->assertSame('<input id="id" type="text" value="yo1" placeholder="yo2" name="name" />' . "\n", BridgeCard::getTextInput($entry, 'id', 'name'));
$this->assertSame('<input id="id" type="text" value="yo1" placeholder="yo2" name="name" />', BridgeCard::getTextInput($entry, 'id', 'name'));
$entry = [
'values' => [],
];
$this->assertSame('<select id="id" name="name" ></select>', BridgeCard::getListInput($entry, 'id', 'name'));
$this->assertSame('<select id="id" name="name" >' . "\n" . '</select>', BridgeCard::getListInput($entry, 'id', 'name'));
$entry = [
'defaultValue' => 2,
@@ -43,7 +43,7 @@ class BridgeCardTest extends TestCase
'foo' => 'bar',
],
];
$this->assertSame('<select id="id" name="name" ><option value="bar">foo</option></select>', BridgeCard::getListInput($entry, 'id', 'name'));
$this->assertSame('<select id="id" name="name" >' . "\n" . '<option value="bar">foo</option>' . "\n" . '</select>', BridgeCard::getListInput($entry, 'id', 'name'));
// optgroup
$entry = [
@@ -52,6 +52,9 @@ class BridgeCardTest extends TestCase
'f' => 'b',
]],
];
$this->assertSame('<select id="id" name="name" ><optgroup label="kek"><option value="b">f</option></optgroup></select>', BridgeCard::getListInput($entry, 'id', 'name'));
$this->assertSame(
'<select id="id" name="name" >' . "\n" . '<optgroup label="kek"><option value="b">f</option></optgroup></select>',
BridgeCard::getListInput($entry, 'id', 'name')
);
}
}
}