public function __construct($part, $name, $value = '', $label = false) { $part = 'controls/' . $part; if ($label === false) { $label = Inflector::toEnglish($name); } if ($value === true) { $value = '__true__'; } else { if ($value === false) { $value = '__false__'; } } parent::__construct($part, $this, $name, $value, $label); }
function testCurryingOptional() { $one = 'one'; $two = 2; $three = 'three'; ob_start(); $block = new PartBlock($this->multi, $one); $block->set('third', $three)->draw($two); $content = ob_get_clean(); $this->assertEquals('onethreeonethree', $content); }