first commit
This commit is contained in:
66
vendor/yiisoft/yii2-bootstrap5/tests/BreadcrumbsTest.php
vendored
Normal file
66
vendor/yiisoft/yii2-bootstrap5/tests/BreadcrumbsTest.php
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace yiiunit\extensions\bootstrap5;
|
||||
|
||||
use yii\bootstrap5\Breadcrumbs;
|
||||
|
||||
/**
|
||||
* @group bootstrap5
|
||||
*/
|
||||
class BreadcrumbsTest extends TestCase
|
||||
{
|
||||
public function testRender()
|
||||
{
|
||||
Breadcrumbs::$counter = 0;
|
||||
$out = Breadcrumbs::widget([
|
||||
'homeLink' => [
|
||||
'label' => 'Home',
|
||||
'url' => '#',
|
||||
],
|
||||
'links' => [
|
||||
[
|
||||
'label' => 'Library',
|
||||
'url' => '#',
|
||||
],
|
||||
[
|
||||
'label' => 'Data',
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$expected = <<<HTML
|
||||
<nav aria-label="breadcrumb"><ol id="w0" class="breadcrumb"><li class="breadcrumb-item"><a href="#">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="#">Library</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Data</li>
|
||||
</ol></nav>
|
||||
HTML;
|
||||
$this->assertEqualsWithoutLE($expected, $out);
|
||||
}
|
||||
|
||||
public function testRenderWithoutHomeLink()
|
||||
{
|
||||
Breadcrumbs::$counter = 0;
|
||||
$out = Breadcrumbs::widget([
|
||||
'homeLink' => false,
|
||||
'links' => [
|
||||
[
|
||||
'label' => 'Library',
|
||||
'url' => '#',
|
||||
],
|
||||
[
|
||||
'label' => 'Data',
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$expected = <<<HTML
|
||||
<nav aria-label="breadcrumb"><ol id="w0" class="breadcrumb"><li class="breadcrumb-item"><a href="#">Library</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Data</li>
|
||||
</ol></nav>
|
||||
HTML;
|
||||
|
||||
$this->assertEqualsWithoutLE($expected, $out);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user