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(); }