assertSame('', BridgeCard::getInputAttributes([])); $this->assertSame(' required pattern="\d+"', BridgeCard::getInputAttributes(['required' => true, 'pattern' => '\d+'])); $entry = [ 'defaultValue' => 'checked', ]; $this->assertSame('' . "\n", BridgeCard::getCheckboxInput($entry, 'id', 'name')); $entry = [ 'defaultValue' => 42, 'exampleValue' => 43, ]; $this->assertSame('' . "\n", BridgeCard::getNumberInput($entry, 'id', 'name')); $entry = [ 'defaultValue' => 'yo1', 'exampleValue' => 'yo2', ]; $this->assertSame('', BridgeCard::getTextInput($entry, 'id', 'name')); $entry = [ 'values' => [], ]; $this->assertSame('', BridgeCard::getListInput($entry, 'id', 'name')); $entry = [ 'defaultValue' => 2, 'values' => [ 'foo' => 'bar', ], ]; $this->assertSame('', BridgeCard::getListInput($entry, 'id', 'name')); // optgroup $entry = [ 'defaultValue' => 2, 'values' => ['kek' => [ 'f' => 'b', ]], ]; $this->assertSame( '', BridgeCard::getListInput($entry, 'id', 'name') ); } }