diff options
Diffstat (limited to 'tests/PlanetTest.php')
-rw-r--r-- | tests/PlanetTest.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/PlanetTest.php b/tests/PlanetTest.php index d4b87b8..1bc699b 100644 --- a/tests/PlanetTest.php +++ b/tests/PlanetTest.php @@ -22,10 +22,12 @@ class FoolItem { protected $categories; - public function __construct($categories) + public function __construct($categories = null) { - foreach ($categories as $c) { - $this->categories[] = new FoolCategory($c); + if (is_array($categories)) { + foreach ($categories as $c) { + $this->categories[] = new FoolCategory($c); + } } } @@ -49,7 +51,8 @@ class PlanetTest extends TestCase new FoolItem(array('catA', 'catB', 'catC')), new FoolItem(array('catB')), new FoolItem(array('catA')), - new FoolItem(array('catC')) + new FoolItem(array('catC')), + new FoolItem(), ); } |