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)); }
public function setUp() { parent::setUp(); $this->modx->getParser(); $this->tag = new modPlaceholderTag($this->modx); $this->tag->setCacheable(false); $this->tag->set('name', 'utp'); }
/** * 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(); }
/** * 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'; }
public function setUp() { parent::setUp(); try { } catch (Exception $e) { $this->modx->log(modX::LOG_LEVEL_ERROR, $e->getMessage(), '', __METHOD__, __FILE__, __LINE__); } }
/** * Cleanup data after this test. */ public function tearDown() { parent::tearDown(); $contexts = $this->modx->getCollection('modContext', array('key:LIKE' => '%unittest%')); /** @var modContext $ctx */ foreach ($contexts as $ctx) { $ctx->remove(); } }
/** * Cleanup data after this test. */ public function tearDown() { parent::tearDown(); /** @var modCategory $category */ $categories = $this->modx->getCollection('modCategory', array('category:LIKE' => 'UnitTest%')); foreach ($categories as $category) { $category->remove(); } $this->modx->error->reset(); }
/** * Cleanup data after this test. */ public function tearDown() { parent::tearDown(); $propertySets = $this->modx->getCollection('modPropertySet', array('name:LIKE' => '%UnitTest%')); /** @var modPropertySet $propertySet */ foreach ($propertySets as $propertySet) { $propertySet->remove(); } $this->modx->error->reset(); }
/** * Cleanup data after this test. */ public function tearDown() { parent::tearDown(); $plugins = $this->modx->getCollection('modPlugin', array('name:LIKE' => '%UnitTest%')); /** @var modPlugin $plugin */ foreach ($plugins as $plugin) { $plugin->remove(); } $this->modx->error->reset(); }
/** * Cleanup data after this test. */ public function tearDown() { parent::tearDown(); $templates = $this->modx->getCollection('modTemplate', array('templatename:LIKE' => '%UnitTest%')); /** @var modTemplate $template */ foreach ($templates as $template) { $template->remove(); } $this->modx->error->reset(); }
/** * 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')); }
/** * Cleanup data after this test. */ public function tearDown() { parent::tearDown(); 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(); } } }
public function tearDown() { parent::tearDown(); /** @var modResource $resource */ $resource = $this->modx->getObject('modResource', array('pagetitle' => 'Unit Test Resource')); if ($resource) { $resource->remove(); } $resource = $this->modx->getObject('modResource', array('pagetitle' => 'Unit Test Child Resource')); if ($resource) { $resource->remove(); } }
/** * Cleanup data after this test. */ public function tearDown() { parent::tearDown(); /** @var modNamespace $namespace */ $namespace = $this->modx->getObject('modNamespace', array('name' => 'unittest')); $namespace->remove(); $actions = $this->modx->getCollection('modAction', array('namespace' => 'unittest')); /** @var modAction $action */ foreach ($actions as $action) { $action->remove(); } $this->modx->error->reset(); }
/** * Cleanup data after this test. */ public function tearDown() { parent::tearDown(); /** @var modContext $ctx */ $ctx = $this->modx->getObject('modContext', 'unittest'); if ($ctx) { $ctx->remove(); } $settings = $this->modx->getCollection('modContextSetting', array('context_key' => 'unittest')); /** @var modContextSetting $setting */ foreach ($settings as $setting) { $setting->remove(); } }
/** * Cleanup data after each test. */ public function tearDown() { parent::tearDown(); $chunks = $this->modx->getCollection('modChunk', array('name:LIKE' => '%UnitTest%')); /** @var modChunk $chunk */ foreach ($chunks as $chunk) { $chunk->remove(); } /** @var modCategory $category */ $category = $this->modx->getObject('modCategory', array('category' => 'UnitTestChunks')); if ($category) { $category->remove(); } $this->modx->error->reset(); }
/** * @return void */ public function tearDown() { parent::tearDown(); /** @var modNamespace $namespace */ $namespace = $this->modx->getObject('modNamespace', array('name' => 'unit-test')); if ($namespace) { $namespace->remove(); } $actions = $this->modx->getCollection('modAction', array('namespace' => 'unit-test')); /** @var modAction $action */ foreach ($actions as $action) { $action->remove(); } $this->modx->setOption('request_param_alias', 'q'); $this->modx->setOption('request_param_id', 'id'); $this->modx->setOption('site_start', 1); $this->modx->setOption('friendly_urls', true); $this->modx->setOption('container_suffix', '/'); }
public function tearDown() { parent::tearDown(); /* Remove test categories */ $category = $this->modx->getIterator('modResource', array('pagetitle:LIKE' => '%UnitTest%')); /** @var msCategory $cat */ foreach ($category as $cat) { $cat->remove(); } $this->modx->query("ALTER TABLE " . $this->modx->getTableName('msCategory') . " AUTO_INCREMENT = 0;"); /* Remove test options */ $objs = $this->modx->getIterator('msOption', array('key:LIKE' => '%UnitTest%')); /** @var xPDOObject $obj */ foreach ($objs as $obj) { $obj->remove(); } $this->modx->query("ALTER TABLE " . $this->modx->getTableName('msOption') . " AUTO_INCREMENT = 0;"); $this->modx->query("ALTER TABLE " . $this->modx->getTableName('msProductData') . " AUTO_INCREMENT = 0;"); $this->modx->query("ALTER TABLE " . $this->modx->getTableName('msCategoryOption') . " AUTO_INCREMENT = 0;"); $this->modx->query("ALTER TABLE " . $this->modx->getTableName('msProductOption') . " AUTO_INCREMENT = 0;"); }
public function tearDown() { parent::tearDown(); $this->modx->placeholders = array(); }
public function tearDown() { parent::tearDown(); $this->plugin = null; }
public function tearDown() { parent::tearDown(); $this->source = null; }
public function tearDown() { parent::tearDown(); $this->controller = null; }
public function tearDown() { parent::tearDown(); $this->processor = null; }
public function setUp() { parent::setUp(); $this->modx->loadClass('modLexicon', null, true, true); $this->lexicon = new modLexicon($this->modx); }
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); }
public function tearDown() { parent::tearDown(); $this->snippet->remove(); $this->snippet = null; }
public function setUp() { parent::setUp(); }
/** * Ensure that the error class is reset on each load */ public function tearDown() { parent::tearDown(); $this->modx->services['error'] = null; $this->modx->error = null; }
public function tearDown() { parent::tearDown(); $this->template = null; }