Skip to content

Commit 1df8cce

Browse files
committed
adding more stuff
1 parent e6e529b commit 1df8cce

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

spec/Codesleeve/Platform/Navigation/NavigatorSpec.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function it_can_list_navigation_items_in_alphabetical_order()
5252
$this->add([ 'title' => 'Dashboard', 'icon' => 'fa-dashboard', 'url' => 'dashboard', 'shown' => true, 'active' => 'dashboard']);
5353
$this->add([ 'title' => 'Roles', 'icon' => 'fa-eye', 'url' => 'roles.index', 'shown' => true, 'active' => 'roles' ]);
5454

55-
$items = $this->sort()->all();
55+
$items = $this->all();
5656

5757
$items[0]->title->shouldBe('Dashboard');
5858
$items[1]->title->shouldBe('Roles');
@@ -65,11 +65,10 @@ function it_can_prioritize_navigation_items_while_sorting()
6565
$this->add([ 'title' => 'Dashboard', 'icon' => 'fa-dashboard', 'url' => 'dashboard', 'shown' => true, 'active' => 'dashboard']);
6666
$this->add([ 'title' => 'Roles', 'icon' => 'fa-eye', 'url' => 'roles.index', 'shown' => true, 'active' => 'roles', 'priority' => 99 ]);
6767

68-
$items = $this->sort()->all();
68+
$items = $this->all();
6969

7070
$items[0]->title->shouldBe('Roles');
7171
$items[1]->title->shouldBe('Dashboard');
7272
$items[2]->title->shouldBe('Users');
7373
}
74-
7574
}

src/Codesleeve/Platform/Support/Collection.php

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
abstract class Collection implements ArrayAccess, Countable, Iterator
66
{
7+
/**
8+
* Cursor of the array
9+
*
10+
* @var int
11+
*/
12+
protected $cursor;
13+
714
/**
815
* Collection of items
916
*
@@ -17,6 +24,8 @@ abstract class Collection implements ArrayAccess, Countable, Iterator
1724
*/
1825
public function __construct($items = array())
1926
{
27+
$this->cursor = 0;
28+
2029
$this->items = new ArrayObject;
2130

2231
foreach ($items as $item)

0 commit comments

Comments
 (0)