/** * * @depends testConstruct */ public function testAddSection(fpErrorNotifierMessage $message) { $message->addSection('Test', array('bar' => 'foo')); $expectedData = array('Summary' => array('foo' => 'bar'), 'Test' => array('bar' => 'foo')); $this->assertAttributeEquals($expectedData, '_data', $message); return $message; }
public function testRender() { $helper = new fpErrorNotifierMessageHelper(); $notifier = $this->getStubStrict('fpErrorNotifier', array('helper' => $helper), array(), '', false); fpErrorNotifier::setInstance($notifier); $message = new fpErrorNotifierMessage('foo title'); $message->addSection('test one', array('bar' => 'foo')); $decorator = new fpErrorNotifierDecoratorHtml($message); $text = $decorator->render(); $this->assertType('string', $text); $this->assertContains('Summary', $text); $this->assertContains('Environment', $text); $this->assertContains('Test One', $text); }