-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from chrismichaels84/develop
Merge Develop into Master (v0.8.2)
- Loading branch information
Showing
11 changed files
with
217 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
namespace Michaels\Manager\Exceptions; | ||
|
||
use Exception; | ||
use Interop\Container\Exception\ContainerException; | ||
use Psr\Log\InvalidArgumentException; | ||
|
||
/** | ||
* NestingUnderNonArrayException | ||
* | ||
* Thrown if you try to nest a new value under an existing non-array value | ||
* | ||
* $manager = new Manager(['one' => 1]); | ||
* $manager->add("one.two", "two-value"); | ||
* | ||
* @package Michaels\Manager | ||
*/ | ||
class NestingUnderNonArrayException extends InvalidArgumentException | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
namespace Michaels\Manager\Test; | ||
|
||
use Michaels\Manager\Manager; | ||
use Michaels\Manager\Test\Stubs\CustomizedManagerStub; | ||
|
||
/** | ||
* Tests customized implementations of Manager. | ||
* Does NOT test ManagesItemsTrait api. | ||
*/ | ||
class CustomizedManagerTest extends \PHPUnit_Framework_TestCase { | ||
|
||
public function testInitManager() | ||
{ | ||
$expectedItems = ['one' => 1, 'two' => 2]; | ||
$expectedOther = 'other-field'; | ||
|
||
$manager = new CustomizedManagerStub($expectedItems, $expectedOther); | ||
|
||
$this->assertEquals($expectedItems, $manager->getAll(), "failed to return the items from initManager"); | ||
$this->assertEquals($expectedOther, $manager->getOther(), "failed to return customized field"); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ | |
class ChainsNestedItemsTraitStub | ||
{ | ||
use ManagesItemsTrait, ChainsNestedItemsTrait; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
namespace Michaels\Manager\Test\Stubs; | ||
use Michaels\Manager\Manager; | ||
|
||
/** | ||
* Class CustomizedManagerStub | ||
* @package Stubs | ||
*/ | ||
class CustomizedManagerStub extends Manager | ||
{ | ||
protected $other; | ||
public function __construct($items, $other) | ||
{ | ||
$this->initManager($items); | ||
$this->other = $other; | ||
} | ||
|
||
public function getOther() | ||
{ | ||
return $this->other; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
class ManagesItemsTraitStub | ||
{ | ||
use ManagesItemsTrait; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters