/** * @test */ public function addsAttachment() { $cc = new phpList\plugin\ViewBrowserPlugin\ContentCreator($this->daoStub, $this->daoAttrStub); $result = $cc->createContent(28, '2f93856905d26f592c7cfefbff599a0e'); $expected = '<p>Attachments:<br><img src="./?p=image&pi=CommonPlugin&image=attach.png" alt="" title=""> an attachment <a href="http://mysite.com/lists/lt.php?id=fhoFAAsfBw5EBAU%3D">attachment.doc</a> 123.5kB<br><img src="./?p=image&pi=CommonPlugin&image=attach.png" alt="" title=""> another attachment <a href="http://mysite.com/lists/lt.php?id=fhoFAAofBw5EBAU%3D">attachment2.doc</a> 7.7kB<br></p>'; $this->assertContains($expected, $result); }
require_once dirname(__FILE__) . '/admin/defaultconfig.php'; require_once dirname(__FILE__) . '/admin/connect.php'; include_once dirname(__FILE__) . '/admin/lib.php'; include_once dirname(__FILE__) . '/admin/sendemaillib.php'; if (!extension_loaded('xsl')) { echo s('The xsl extension must be installed'); exit; } if (!(isset($_GET['m']) && ctype_digit($_GET['m']))) { echo s('A numeric message id must be specified'); exit; } if (getConfig('viewbrowser_anonymous')) { $uid = isset($_GET['uid']) ? $_GET['uid'] : ''; } else { if (!isset($_GET['uid'])) { echo s('A user uid must be specified'); exit; } $uid = $_GET['uid']; } if (!isset($plugins['CommonPlugin'])) { echo s('CommonPlugin must be installed'); exit; } error_reporting(-1); require_once $plugins['CommonPlugin']->coderoot . 'Autoloader.php'; $creator = new phpList\plugin\ViewBrowserPlugin\ContentCreator(); ob_end_clean(); header('Content-Type: text/html; charset=UTF-8'); echo $creator->createContent($_GET['m'], $uid);