3 declare(strict_types=1);
39 $class = ilWebLinkItemInternal::class;
41 $class = ilWebLinkItemExternal::class;
44 $item = $this->getMockBuilder($class)
45 ->disableOriginalConstructor()
46 ->onlyMethods([
'getTitle',
'getLinkId'])
49 $item->method(
'getTitle')->willReturn($title);
50 $item->method(
'getLinkId')->willReturn($link_id);
67 $sort_settings = Mockery::mock(
'alias:' . ilContainerSortingSettings::class);
68 $sort_settings->shouldReceive(
'_lookupSortMode')
73 $sort = Mockery::mock(
'alias:' . ilContainerSorting::class);
74 $sort->shouldReceive(
'lookupPositions')
77 ->andReturn([1 => 10, 2 => 30, 3 => 20]);
79 $array_util = Mockery::mock(
'alias:' . ilArrayUtil::class);
80 $array_util->shouldReceive(
'sortArray')
84 3 => [
'title' =>
'a',
'item' => $item3],
85 2 => [
'title' =>
'b',
'item' => $item2],
86 1 => [
'title' =>
'c',
'item' => $item1],
87 5 => [
'title' =>
'd',
'item' => $item5],
88 4 => [
'title' =>
'e',
'item' => $item4]
91 1 => [
'position' => 10,
'item' => $item1],
92 3 => [
'position' => 20,
'item' => $item3],
93 2 => [
'position' => 30,
'item' => $item2]
96 5 => [
'title' =>
'd',
'item' => $item5],
97 4 => [
'title' =>
'e',
'item' => $item4]
103 [$item1, $item2, $item3, $item4, $item5]
108 [$item3, $item2, $item1, $item5, $item4],
113 [$item1, $item3, $item2, $item5, $item4],
createItemMock(bool $internal, string $title, int $link_id)
Unit tests for ilWebLinkItemsContainer.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...