1<?php 2 3//this has to be set up to right path 4require_once DOKU_INC . 'lib/plugins/latexit/classes/Package.php'; 5 6/** 7 * Package tests for the latexit plugin 8 * 9 * @group plugin_latexit_classes 10 * @group plugin_latexit 11 * @group plugins 12 */ 13class paclage_plugin_latexit_test extends DokuWikiTest { 14 15 /** 16 * These plugins will be loaded for testing. 17 * @var array 18 */ 19 protected $pluginsEnabled = array('latexit', 'mathjax', 'imagereference', 'zotero'); 20 21 /** 22 * Testing getName method. 23 */ 24 public function test_getName() { 25 $p = new Package("balik"); 26 $this->assertEquals("balik", $p->getName()); 27 } 28 29 /** 30 * Testing printParameters and addParameter methods. 31 */ 32 public function test_printParameters() { 33 $p = new Package("balik"); 34 $this->assertEquals("", $p->printParameters()); 35 $p->addParameter("param"); 36 $this->assertEquals("[param]", $p->printParameters()); 37 $p->addParameter("p"); 38 $this->assertEquals("[param, p]", $p->printParameters()); 39 } 40 41 /** 42 * Testing printCommands and addCommand methods. 43 */ 44 public function test_printCommands() { 45 $p = new Package("balik"); 46 $this->assertEquals("", $p->printCommands()); 47 $p->addCommand("\use{aaa}"); 48 $this->assertEquals("\use{aaa}\n", $p->printCommands()); 49 $p->addCommand("\remove{bbb}"); 50 $this->assertEquals("\use{aaa}\n\remove{bbb}\n", $p->printCommands()); 51 } 52 53} 54