/** * @test * @dataProvider defaultValueDataProvider */ public function defaultValueGetsRecognizedCorrectly($defaultValue) { $parameter = new Parameter(['value' => ['name' => 'myParam', 'default' => $defaultValue]]); self::assertSame($defaultValue, $parameter->getDefaultValue()); }
/** * <ul> * <li>If a sub-parameter has been set, returns its getOutput()</li> * <li>Else, if a default parameter has been set, returns its getOutput()</li> * <li>Else, if a default value as been set using setDefaultValue(), returns it.</li> * <li>Else, returns empty string.</li> * </ul> * * @return string */ public function getOutput() { if (!is_null($parameter = $this->getParameter())) { return $parameter->getOutput(); } else { return parent::getDefaultValue(); } }