public function setNeeds($option) { if (!is_array($option)) { $option = array($option); } foreach ($option as $opt) { $this->needs[] = $opt; } return $this; }
/** * Test that the needed requirements are met */ public function testOptionRequirementsMet() { $option = new Option('f'); $option->setNeeds('foo'); $optionSet = array('foo' => new Option('foo')); $this->assertTrue($option->hasNeeds($optionSet)); }