Exemplo n.º 1
0
 public function testComputedTags()
 {
     $context = new Context('foo');
     $context->setContent(array('one' => 'value', 'two' => '', 'three' => 'value'));
     $context->select('sub')->add('content', array('computedTags' => true));
     $decorator = new Contexts(array('name' => 'sub', 'separator' => ';'));
     $decorator->context($context);
     $actual = $decorator->render();
     $expected = 'first,even;empty,odd;last,even;';
     $this->assertEquals($expected, $actual);
 }
Exemplo n.º 2
0
 public function testSimple()
 {
     $context = new MainContext('foo');
     $context->add('dummy');
     $context->setContent(array('one', 'two'));
     $decorator = new Contexts('foo');
     $decorator->context($context);
     $actual = $decorator->render();
     $expected = 'dummy()dummy()';
     $this->assertEquals($actual, $expected);
 }