public function ForumListingBreadcrumbBuilderTest::providerTestApplies in Drupal 8
Provides test data for testApplies().
Return value
array Array of datasets for testApplies(). Structured as such:
- ForumListBreadcrumbBuilder::applies() expected result.
- ForumListBreadcrumbBuilder::applies() $attributes input array.
File
- core/
modules/ forum/ tests/ src/ Unit/ Breadcrumb/ ForumListingBreadcrumbBuilderTest.php, line 83
Class
- ForumListingBreadcrumbBuilderTest
- @coversDefaultClass \Drupal\forum\Breadcrumb\ForumListingBreadcrumbBuilder @group forum
Namespace
Drupal\Tests\forum\Unit\BreadcrumbCode
public function providerTestApplies() {
// Send a Node mock, because NodeInterface cannot be mocked.
$mock_term = $this
->getMockBuilder('Drupal\\taxonomy\\Entity\\Term')
->disableOriginalConstructor()
->getMock();
return [
[
FALSE,
],
[
FALSE,
'NOT.forum.page',
],
[
FALSE,
'forum.page',
],
[
TRUE,
'forum.page',
[
[
'taxonomy_term',
'anything',
],
],
],
[
TRUE,
'forum.page',
[
[
'taxonomy_term',
$mock_term,
],
],
],
];
}