*/
public function testIssue3525()
{
- $xml = $this->factory('XML', 'event');
+ $xml = $this->getFactory()->create('XML', 'event');
// Load XML
$event = file_get_contents(dirname(__FILE__)
*/
public function testGetName()
{
- $format = $this->factory('XML', 'contact');
+ $format = $this->getFactory()->create('XML', 'contact');
$this->assertEquals('kolab.xml', $format->getName());
}
*/
public function testMimeType()
{
- $format = $this->factory('XML', 'contact');
+ $format = $this->getFactory()->create('XML', 'contact');
$this->assertEquals('application/x-vnd.kolab.contact',
$format->getMimeType());
}
*/
public function testGetDisposition()
{
- $format = $this->factory('XML', 'contact');
+ $format = $this->getFactory()->create('XML', 'contact');
$this->assertEquals('attachment', $format->getDisposition());
}
}
*/
public function testBug6388()
{
- $xml = $this->factory('XML', 'event');
+ $xml = $this->getFactory()->create('XML', 'event');
// Load XML
$recur = file_get_contents(dirname(__FILE__) . '/fixtures/recur.xml');
// Load XML
- $xml = $this->factory('XML', 'event');
+ $xml = $this->getFactory()->create('XML', 'event');
$recur = file_get_contents(dirname(__FILE__) . '/fixtures/recur_fail.xml');
// Check that the xml fails because of a missing interval value
*/
public function testExceptions()
{
- $xml = $this->factory('XML', 'event');
+ $xml = $this->getFactory()->create('XML', 'event');
// Load XML
$recur = file_get_contents(dirname(__FILE__) . '/fixtures/recur.xml');
*/
public function testCompletions()
{
- $xml = $this->factory('XML', 'event');
+ $xml = $this->getFactory()->create('XML', 'event');
$r = new Horde_Date_Recurrence(0);
$r->setRecurType(Horde_Date_Recurrence::RECUR_DAILY);
*/
public function testBasicTask()
{
- $xml = $this->factory('XML', 'task');
+ $xml = $this->getFactory()->create('XML', 'task');
// Load XML
$task = file_get_contents(dirname(__FILE__) . '/../fixtures/task.xml');
class Horde_Kolab_Format_TestCase
extends PHPUnit_Framework_TestCase
{
- public function factory(
- $format_type = '', $object_type = '', $params = null
- ) {
- $factory = new Horde_Kolab_Format_Factory();
- return $factory->create($format_type, $object_type, $params);
+ private $_factory;
+
+ protected function getFactory()
+ {
+ if ($this->_factory === null) {
+ $this->_factory = new Horde_Kolab_Format_Factory();
+ }
+ return $this->_factory;
}
}