Skip to content

Commit

Permalink
Improve doc block comment and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Mar 11, 2019
1 parent 0dddcd5 commit a10be9f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Cms/Collections.php
Expand Up @@ -101,12 +101,12 @@ public function has(string $name): bool
}

/**
* Loads collection from php file in a
* given directory or from plugin extension.
*
* @param string $name
* @return mixed
*/
* Loads collection from php file in a
* given directory or from plugin extension.
*
* @param string $name
* @return mixed
*/
public function load(string $name)
{
$kirby = App::instance();
Expand Down
8 changes: 8 additions & 0 deletions tests/Cms/CollectionsTest.php
Expand Up @@ -12,6 +12,7 @@ protected function _app()
]
]);
}

public function testGet()
{
$app = $this->_app();
Expand Down Expand Up @@ -60,4 +61,11 @@ public function testLoad()
$result = $app->collections()->load('nested/test');
$this->assertEquals('a', $result());
}

public function testLoadNested()
{
$app = $this->_app();
$result = $app->collections()->load('nested/test');
$this->assertEquals('a', $result());
}
}

0 comments on commit a10be9f

Please sign in to comment.