$this->
assertEquals('bar',
$helper->
get('bar', 'bar'
), '->get() takes a default value to return if the slot does not exist'
);
$this->
assertTrue($helper->
has('foo'
), '->has() returns true if the slot exists'
);
$this->
assertFalse($helper->
has('bar'
), '->has() returns false if the slot does not exist'
);
} public function testOutput() { $helper =
new SlotsHelper();
$helper->
set('foo', 'bar'
);
ob_start();
$ret =
$helper->
output('foo'
);
$output =
ob_get_clean();
$this->
assertEquals('bar',
$output, '->output() outputs the content of a slot'
);
$this->
assertTrue($ret, '->output() returns true if the slot exists'
);
ob_start();
$ret =
$helper->
output('bar', 'bar'
);
$output =
ob_get_clean();
$this->
assertEquals('bar',
$output, '->output() takes a default value to return if the slot does not exist'
);
$this->
assertTrue($ret, '->output() returns true if the slot does not exist but a default value is provided'
);
ob_start();