public function setUp()
 {
     parent::setUp();
     $this->modx->loadClass('modProcessor', MODX_CORE_PATH . 'model/modx/', true, true);
     $this->processor = new modProcessor($this->modx);
     $this->processor->setPath(MODX_BASE_PATH . self::MODX_TEST_PROCESSOR);
 }
 public function setUp()
 {
     parent::setUp();
     $this->modx->loadClass('mail.modMail', MODX_CORE_PATH . 'model/modx/', true, true);
     $this->mail = $this->getMockForAbstractClass('modMail', array(&$this->modx));
     $this->mail->expects($this->any())->method('_getMailer')->will($this->returnValue(true));
 }
 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->modx->loadClass('sources.modMediaSource');
     $this->source = $this->modx->newObject('sources.modMediaSource');
     $this->source->fromArray(array('name' => 'UnitTestSource', 'description' => '', 'class_key' => 'sources.modFileMediaSource', 'properties' => array()), '', true);
 }
 public function setUp()
 {
     parent::setUp();
     $this->template = $this->modx->newObject('modTemplate');
     $this->template->fromArray(array('id' => 12345, 'templatename' => 'Unit Test Template', 'description' => 'A template for unit testing.', 'content' => '<p>Hello, [[+name]]!</p>', 'category' => 0, 'locked' => 0), '', true, true);
     $this->template->setProperties(array('name' => 'John'));
     $this->template->setCacheable(false);
 }
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     /** @var modSnippet $snippet */
     $snippet = $this->modx->newObject('modSnippet');
     $snippet->fromArray(array('name' => 'UnitTestSnippet'));
     $snippet->save();
 }
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     /** @var modTemplateVar $tv */
     $tv = $this->modx->newObject('modTemplateVar');
     $tv->fromArray(array('name' => 'UnitTestTv'));
     $tv->save();
 }
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     /** @var modPropertySet $propertySet */
     $propertySet = $this->modx->newObject('modPropertySet');
     $propertySet->fromArray(array('name' => 'UnitTestPropertySet'));
     $propertySet->save();
 }
Exemple #8
0
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     /** @var modPlugin $plugin */
     $plugin = $this->modx->newObject('modPlugin');
     $plugin->fromArray(array('name' => 'UnitTestPlugin'));
     $plugin->save();
 }
 /**
  * Load some utility classes this case uses
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->modx->loadClass('modDashboard');
     $this->modx->loadClass('modManagerController', MODX_CORE_PATH . 'model/modx/', true, true);
     $this->modx->loadClass('modManagerControllerDeprecated', MODX_CORE_PATH . 'model/modx/', true, true);
     require_once MODX_MANAGER_PATH . 'controllers/default/welcome.class.php';
 }
Exemple #10
0
 public function setUp()
 {
     parent::setUp();
     $this->plugin = $this->modx->newObject('modPlugin');
     $this->plugin->fromArray(array('id' => 12345, 'name' => 'Unit Test Plugin', 'description' => 'A plugin for unit testing.', 'plugincode' => 'return "Hello.";', 'category' => 0, 'locked' => false, 'disabled' => false), '', true, true);
     $this->plugin->setProperties(array('name' => 'John'));
     $this->plugin->setCacheable(false);
 }
 public function setUp()
 {
     parent::setUp();
     try {
     } catch (Exception $e) {
         $this->modx->log(modX::LOG_LEVEL_ERROR, $e->getMessage(), '', __METHOD__, __FILE__, __LINE__);
     }
 }
Exemple #12
0
 public function setUp()
 {
     parent::setUp();
     $this->modx->getParser();
     $this->tag = new modPlaceholderTag($this->modx);
     $this->tag->setCacheable(false);
     $this->tag->set('name', 'utp');
 }
 public function setUp()
 {
     parent::setUp();
     $this->chunk = $this->modx->newObject('modChunk');
     $this->chunk->fromArray(array('id' => 12345, 'name' => 'Unit Test Chunk', 'description' => 'A chunk for unit testing.', 'snippet' => '<p>Hello, [[+name]]!</p>', 'category' => 0, 'locked' => 0), '', true, true);
     $this->chunk->setProperties(array('name' => 'John'));
     $this->chunk->setCacheable(false);
 }
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     /** @var modContext $ctx */
     $ctx = $this->modx->newObject('modContext');
     $ctx->set('key', 'unittest');
     $ctx->set('description', 'The unit test context for context settings.');
     $ctx->save();
 }
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     $this->modx->error->reset();
     /** @var modTemplate $template */
     $template = $this->modx->newObject('modTemplate');
     $template->fromArray(array('templatename' => 'UnitTestTemplate'));
     $template->save();
 }
Exemple #16
0
 public function setUp()
 {
     parent::setUp();
     $this->snippet = $this->modx->newObject('modSnippet');
     $this->snippet->fromArray(array('name' => 'Unit Test Snippet', 'description' => 'A snippet for unit testing.', 'snippet' => str_replace('<?php', '', file_get_contents(MODX_BASE_PATH . '_build/test/data/snippets/modSnippetTest/modSnippetTest.snippet.php')), 'category' => 0, 'locked' => false), '', true, true);
     $this->snippet->setProperties(array('name' => 'John'));
     $this->snippet->setCacheable(false);
     $this->snippet->save();
     $this->modx->event = new modSystemEvent();
 }
 /**
  * Load some utility classes this case uses
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->modx->loadClass('modDashboard');
     $this->modx->loadClass('modDashboardWidget');
     $this->modx->loadClass('modManagerController', MODX_CORE_PATH . 'model/modx/', true, true);
     $this->modx->loadClass('modManagerControllerDeprecated', MODX_CORE_PATH . 'model/modx/', true, true);
     require_once MODX_MANAGER_PATH . 'controllers/default/welcome.class.php';
     $this->widget = $this->modx->newObject('modDashboardWidget');
     $this->widget->fromArray(array('name' => 'w_recentlyeditedresources', 'description' => 'w_recentlyeditedresources_desc', 'type' => 'file', 'size' => 'half', 'content' => '[[++manager_path]]controllers/default/dashboard/widget.grid-rer.php', 'namespace' => 'core', 'lexicon' => 'core:dashboards'));
 }
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     /** @var modCategory $category */
     $category = $this->modx->newObject('modCategory');
     $category->fromArray(array('category' => 'UnitTestCategory'));
     $category->save();
     $category = $this->modx->newObject('modCategory');
     $category->fromArray(array('category' => 'UnitTestCategory2'));
     $category->save();
 }
Exemple #19
0
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     /** @var modNamespace $namespace */
     $namespace = $this->modx->newObject('modNamespace');
     $namespace->set('name', 'unittest');
     $namespace->save();
     /** @var modAction $action */
     $action = $this->modx->newObject('modAction');
     $action->fromArray(array('namespace' => 'unittest', 'controller' => 'unittest', 'parent' => 0, 'haslayout' => true, 'assets' => '', 'lang_topics' => '', 'help_url' => 'Actions'));
     $action->save();
 }
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     $this->modx->eventMap = array();
     if ($this->modx instanceof modX) {
         $resources = $this->modx->getCollection('modResource', array('pagetitle:LIKE' => '%Unit Test Resource%'));
         /** @var modResource $resource */
         foreach ($resources as $resource) {
             $resource->remove();
         }
     }
 }
Exemple #21
0
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     /** @var modContext $ctx */
     $ctx = $this->modx->newObject('modContext');
     $ctx->fromArray(array('key' => 'unittest'), '', true, true);
     $ctx->save();
     $ctx = $this->modx->newObject('modContext');
     $ctx->set('key', 'unittest13');
     $ctx->set('description', 'The unit test numbered 13. What else would it be?');
     $ctx->save();
 }
Exemple #22
0
 public function setUp()
 {
     parent::setUp();
     /** @var modResource $resource */
     $resource = $this->modx->newObject('modResource');
     $resource->fromArray(array('id' => 12345, 'pagetitle' => 'Unit Test Resource', 'type' => 'document', 'contentType' => 1, 'longtitle' => '', 'description' => '', 'alias' => 'unit-test', 'published' => true, 'parent' => 0, 'isfolder' => true, 'menuindex' => 99999, 'content' => '<h2>A Unit Test Resource</h2>', 'template' => 0, 'searchable' => true, 'cacheable' => true, 'deleted' => false, 'menutitle' => 'Unit Test Resource', 'hidemenu' => false, 'class_key' => 'modDocument', 'context_key' => 'web', 'content_type' => 1), '', true, true);
     $resource->save();
     $resource = $this->modx->newObject('modResource');
     $resource->fromArray(array('id' => 12346, 'parent' => 12345, 'pagetitle' => 'Unit Test Child Resource', 'type' => 'document', 'contentType' => 1, 'longtitle' => '', 'description' => '', 'alias' => 'child', 'published' => true, 'isfolder' => false, 'menuindex' => 99999, 'content' => '<h2>A Unit Test Child Resource</h2>', 'template' => 0, 'searchable' => true, 'cacheable' => true, 'deleted' => false, 'menutitle' => 'Unit Test Child Resource', 'hidemenu' => false, 'class_key' => 'modDocument', 'context_key' => 'web', 'content_type' => 1), '', true, true);
     $resource->save();
     $this->modx->setOption('friendly_urls', true);
     $this->modx->context->prepare(true);
 }
Exemple #23
0
 /**
  * Setup some basic data for this test.
  */
 public function setUp()
 {
     parent::setUp();
     $this->modx->lexicon->load('chunk');
     /** @var modChunk $chunk */
     $chunk = $this->modx->newObject('modChunk');
     $chunk->fromArray(array('name' => 'UnitTestChunk'));
     $chunk->save();
     /** @var modCategory $category */
     $category = $this->modx->newObject('modCategory');
     $category->set('id', 1);
     $category->set('category', 'UnitTestChunks');
     $category->save();
 }
 public function setUp()
 {
     parent::setUp();
     /* load smarty template engine */
     $templatePath = $this->modx->getOption('manager_path') . 'templates/default/';
     $this->modx->getService('smarty', 'smarty.modSmarty', '', array('template_dir' => $templatePath));
     $this->modx->smarty->setCachePath('mgr/smarty/default/');
     $this->modx->smarty->assign('_config', $this->modx->config);
     $this->modx->smarty->assignByRef('modx', $this->modx);
     $this->modx->loadClass('modManagerController', MODX_CORE_PATH . 'model/modx/', true, true);
     require_once MODX_MANAGER_PATH . 'controllers/default/' . $this->controllerPath . '.class.php';
     $className = $this->controllerName;
     if (!empty($className)) {
         $this->controller = new $className($this->modx, array('namespace' => 'core', 'namespace_name' => 'core', 'namespace_path' => MODX_MANAGER_PATH, 'controller' => $this->controllerPath));
         $this->controller->setProperties($_REQUEST);
     }
 }
Exemple #25
0
 /**
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     /** @var modNamespace $namespace */
     $namespace = $this->modx->newObject('modNamespace');
     $namespace->set('name', 'unit-test');
     $namespace->set('path', '{core_path}');
     $namespace->save();
     /** @var modAction $action */
     $action = $this->modx->newObject('modAction');
     $action->fromArray(array('namespace' => 'unit-test', 'parent' => 0, 'controller' => 'index', 'haslayout' => 1, 'lang_topics' => ''));
     $action->save();
     $_POST['testPost'] = 1;
     $_GET['testGet'] = 2;
     $_COOKIE['testCookie'] = 3;
     $_REQUEST['testRequest'] = 4;
     $this->modx->loadClass('modRequest', null, true, true);
     $this->request = new modRequest($this->modx);
 }
 public function setUp()
 {
     parent::setUp();
     $this->controller = new modManagerControllerDeprecated($this->modx);
 }
 public function setUp()
 {
     parent::setUp();
     $this->modx->loadClass('modLexicon', null, true, true);
     $this->lexicon = new modLexicon($this->modx);
 }
Exemple #28
0
 public function setUp()
 {
     parent::setUp();
     $this->user = $this->modx->newObject('modUser');
     $this->user->fromArray(array('id' => 123456, 'username' => 'unit-test-user', 'password' => md5('boogles'), 'cachepwd' => '', 'class_key' => 'modUser', 'active' => true, 'remote_key' => '', 'remote_data' => array(), 'hash_class' => 'hashing.modMD5', 'salt' => '', 'primary_group' => 1), '', true, true);
 }
 /**
  * Instantiate the modError instance for each test
  */
 public function setUp()
 {
     parent::setUp();
     $this->error = $this->modx->getService('error', 'error.modError');
 }
 public function setUp()
 {
     parent::setUp();
 }