public function setUp() { parent::setUp(); $dir = Director::baseFolder() . '/testcontent'; if (file_exists($dir)) { Filesystem::removeFolder($dir); } $this->contentService = new ContentService(); // set some injector properties $injector = Injector::inst(); $injector->load(array('TestContentReader' => array('class' => 'FileContentReader', 'type' => 'prototype', 'properties' => array('basePath' => $dir)), 'TestContentWriter' => array('class' => 'FileContentWriter', 'type' => 'prototype', 'properties' => array('basePath' => $dir)))); $this->contentService->setStores(array('File' => array('ContentReader' => 'TestContentReader', 'ContentWriter' => 'TestContentWriter'))); $injector->registerService($this->contentService); $this->testDir = $dir; }