Commit 992cdc6d authored by Carsten  Rose's avatar Carsten Rose
Browse files

Refs #8348 - Update Unit Tests

parent 9b712a58
Pipeline #1865 passed with stage
in 2 minutes and 17 seconds
......@@ -1467,22 +1467,22 @@ EOF;
$link = new Link($this->sip, DB_INDEX_DEFAULT, true);
// Empty definition
$expect = '<span class="dropdown"><span title="Details" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 0" ><span class="glyphicon glyphicon-option-vertical" ></span></span><ul class="dropdown-menu" aria-labelledby="0.123 1234 0"></ul></span>';
$expect = '<span class="dropdown"><span title="Details" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 0" ><span class="glyphicon glyphicon-option-vertical" ></span></span><ul style="max-height: 70vh; overflow-y: auto" class="dropdown-menu" aria-labelledby="0.123 1234 0"></ul></span>';
$result = $link->renderLink('z');
$this->assertEquals($expect, $result);
// Empty definition.
$expect = '<span class="dropdown"><span title="Details" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 1" ><span class="glyphicon glyphicon-option-vertical" ></span></span><ul class="dropdown-menu" aria-labelledby="0.123 1234 1"></ul></span>';
$expect = '<span class="dropdown"><span title="Details" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 1" ><span class="glyphicon glyphicon-option-vertical" ></span></span><ul style="max-height: 70vh; overflow-y: auto" class="dropdown-menu" aria-labelledby="0.123 1234 1"></ul></span>';
$result = $link->renderLink('z:');
$this->assertEquals($expect, $result);
// Dropdown menu with text, custom Glyph and a tooltip.
$expect = '<span class="dropdown"><span title="Open menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 2" ><span class="glyphicon glyph-icon-left" ></span> Menu</span><ul class="dropdown-menu" aria-labelledby="0.123 1234 2"></ul></span>';
$expect = '<span class="dropdown"><span title="Open menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 2" ><span class="glyphicon glyph-icon-left" ></span> Menu</span><ul style="max-height: 70vh; overflow-y: auto" class="dropdown-menu" aria-labelledby="0.123 1234 2"></ul></span>';
$result = $link->renderLink('z|t:Menu|G:glyph-icon-left|o:Open menu');
$this->assertEquals($expect, $result);
// Dropdown menu with menu entry.
$expect = '<span class="dropdown"><span title="Open menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 3" ><span class="glyphicon glyph-icon-left" ></span> Menu</span><ul class="dropdown-menu" aria-labelledby="0.123 1234 3"><li><a href="?id=home" >Home</a></li></ul></span>';
$expect = '<span class="dropdown"><span title="Open menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 3" ><span class="glyphicon glyph-icon-left" ></span> Menu</span><ul style="max-height: 70vh; overflow-y: auto" class="dropdown-menu" aria-labelledby="0.123 1234 3"><li><a href="?id=home" >Home</a></li></ul></span>';
$result = $link->renderLink('z|t:Menu|G:glyph-icon-left|o:Open menu||p:home|t:Home');
$this->assertEquals($expect, $result);
......@@ -1492,12 +1492,12 @@ EOF;
$this->assertEquals($expect, $result);
// Dropdown menu with two entries, one is SIP encoded.
$expect = '<span class="dropdown"><span title="Open menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 5" ><span class="glyphicon glyph-icon-left" ></span> Menu</span><ul class="dropdown-menu" aria-labelledby="0.123 1234 5"><li><a href="index.php?id=home&s=badcaffee1234" >Home</a></li><li><a href="?id=back" title="Navigate back" >Back</a></li></ul></span>';
$expect = '<span class="dropdown"><span title="Open menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 5" ><span class="glyphicon glyph-icon-left" ></span> Menu</span><ul style="max-height: 70vh; overflow-y: auto" class="dropdown-menu" aria-labelledby="0.123 1234 5"><li><a href="index.php?id=home&s=badcaffee1234" >Home</a></li><li><a href="?id=back" title="Navigate back" >Back</a></li></ul></span>';
$result = $link->renderLink('z|t:Menu|G:glyph-icon-left|o:Open menu||p:home|t:Home|s||p:back|t:Back|o:Navigate back');
$this->assertEquals($expect, $result);
// Dropdown menu header, separator and disabled entry.
$expect = '<span class="dropdown"><span title="Open menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 6" ><span class="glyphicon glyph-icon-left" ></span> Menu</span><ul class="dropdown-menu" aria-labelledby="0.123 1234 6"><li><a href="index.php?id=home&s=badcaffee1234" >Home</a></li><li><a href="?id=back" title="Navigate back" >Back</a></li><li role="separator" class="divider"></li><li class="dropdown-header">Header</li><li class="disabled"><a href="#">Disabled entry</a></li></ul></span>';
$expect = '<span class="dropdown"><span title="Open menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle" id="0.123 1234 6" ><span class="glyphicon glyph-icon-left" ></span> Menu</span><ul style="max-height: 70vh; overflow-y: auto" class="dropdown-menu" aria-labelledby="0.123 1234 6"><li><a href="index.php?id=home&s=badcaffee1234" >Home</a></li><li><a href="?id=back" title="Navigate back" >Back</a></li><li role="separator" class="divider"></li><li class="dropdown-header">Header</li><li class="disabled"><a href="#">Disabled entry</a></li></ul></span>';
$result = $link->renderLink('z|t:Menu|G:glyph-icon-left|o:Open menu||p:home|t:Home|s||p:back|t:Back|o:Navigate back||r:1|t:---||t:===Header|r:1||r:1|t:---Disabled entry');
$this->assertEquals($expect, $result);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment