Skip to content

Commit 0a9aac3

Browse files
Added LfmItem property selection via config
1 parent c5759af commit 0a9aac3

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ composer.lock
33
/docs/Gemfile.lock
44
/docs/_site
55
.DS_Store
6+
/.idea

tests/LfmItemTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function setUp()
1919

2020
$this->lfm_path = m::mock(LfmPath::class);
2121
$this->lfm_path->shouldReceive('thumb')->andReturn($this->lfm_path);
22+
$this->lfm->shouldReceive('config')->with('item_columns')->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);
2223
}
2324

2425
public function tearDown()
@@ -30,7 +31,7 @@ public function tearDown()
3031

3132
public function testMagicGet()
3233
{
33-
$this->lfm_item = new LfmItem($this->lfm_path, m::mock(Lfm::class));
34+
$this->lfm_item = new LfmItem($this->lfm_path, $this->lfm);
3435

3536
$this->lfm_item->attributes['foo'] = 'bar';
3637

tests/LfmPathTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public function testFolders()
126126
$helper->shouldReceive('getThumbFolderName')->andReturn('thumbs');
127127
$helper->shouldReceive('isRunningOnWindows')->andReturn(false);
128128
$helper->shouldReceive('ds')->andReturn('/');
129+
$helper->shouldReceive('config')->with('item_columns')->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);
129130

130131
$path = new LfmPath($helper);
131132

@@ -145,6 +146,7 @@ public function testFiles()
145146
$helper->shouldReceive('getNameFromPath')->andReturn('bar');
146147
$helper->shouldReceive('isRunningOnWindows')->andReturn(false);
147148
$helper->shouldReceive('ds')->andReturn('/');
149+
$helper->shouldReceive('config')->with('item_columns')->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);
148150

149151
$path = new LfmPath($helper);
150152

@@ -156,6 +158,7 @@ public function testPretty()
156158
$helper = m::mock(Lfm::class);
157159
$helper->shouldReceive('getNameFromPath')->andReturn('bar');
158160
$helper->shouldReceive('isRunningOnWindows')->andReturn(false);
161+
$helper->shouldReceive('config')->with('item_columns')->andReturn(['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url']);
159162

160163
$path = new LfmPath($helper);
161164

0 commit comments

Comments
 (0)