|
@@ 62-77 (lines=16) @@
|
| 59 |
|
); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
public function testCreateBreadCrumbWithEmptyRequestAndEmptyMenu() |
| 63 |
|
{ |
| 64 |
|
$this->createSimpleBreadCrumb(); |
| 65 |
|
|
| 66 |
|
$requestStack = $this->getMockBuilder('\Symfony\Component\HttpFoundation\RequestStack') |
| 67 |
|
->getMock(); |
| 68 |
|
$requestStack->method('getCurrentRequest') |
| 69 |
|
->willReturn( |
| 70 |
|
$this->getMock('\Symfony\Component\HttpFoundation\Request') |
| 71 |
|
); |
| 72 |
|
|
| 73 |
|
$breadCrumb = $this->breadCrumbBuilder->createBreadCrumb($requestStack); |
| 74 |
|
|
| 75 |
|
$this->assertTrue($breadCrumb->hasChildren()); |
| 76 |
|
$this->assertEquals(1, count($breadCrumb->getChildren())); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
public function testIfLastItemDoesNotHaveAnUri() |
| 80 |
|
{ |
|
@@ 95-110 (lines=16) @@
|
| 92 |
|
$this->assertNull($lastChild->getUri()); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
public function testIfBreadCrumbIsEmptyWhenDontExtraFromTheRequestIsEnabled() |
| 96 |
|
{ |
| 97 |
|
$this->createSimpleBreadCrumb(); |
| 98 |
|
$this->breadCrumbBuilder->dontExtractFromTheRequest(); |
| 99 |
|
|
| 100 |
|
$requestStack = $this->getMockBuilder('\Symfony\Component\HttpFoundation\RequestStack') |
| 101 |
|
->getMock(); |
| 102 |
|
$requestStack->method('getCurrentRequest') |
| 103 |
|
->willReturn( |
| 104 |
|
$this->getMock('\Symfony\Component\HttpFoundation\Request') |
| 105 |
|
); |
| 106 |
|
|
| 107 |
|
$breadCrumb = $this->breadCrumbBuilder->createBreadCrumb($requestStack); |
| 108 |
|
|
| 109 |
|
$this->assertFalse($breadCrumb->hasChildren()); |
| 110 |
|
} |
| 111 |
|
|
| 112 |
|
public function testIfSimpleItemIsAdded() |
| 113 |
|
{ |