public function testRun() { $config = $this->context->getConfig(); $mock = $this->getMockBuilder('\\Aimeos\\MAdmin\\Log\\Manager\\Standard')->setMethods(array('deleteItems'))->setConstructorArgs(array($this->context))->getMock(); $mock->expects($this->atLeastOnce())->method('deleteItems'); $tmppath = dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'tmp'; $name = 'ControllerJobsAdminLogDefaultRun'; $config->set('madmin/log/manager/name', $name); $config->set('controller/jobs/admin/log/standard/limit-days', 0); $config->set('controller/jobs/admin/log/standard/path', $tmppath); \Aimeos\MAdmin\Log\Manager\Factory::injectManager('\\Aimeos\\MAdmin\\Log\\Manager\\' . $name, $mock); if (!is_dir($tmppath) && mkdir($tmppath) === false) { throw new \RuntimeException(sprintf('Unable to create temporary path "%1$s"', $tmppath)); } $this->object->run(); foreach (new \DirectoryIterator($tmppath) as $file) { if ($file->isFile() && $file->getExtension() === 'zip') { $container = \Aimeos\MW\Container\Factory::getContainer($file->getPathName(), 'Zip', 'CSV', array()); $container->get('unittest facility.csv'); unlink($file->getPathName()); return; } } $this->fail('Log archive file not found'); }