示例#1
0
 function testReadWriteFile()
 {
     $config = Bootstrap::getServiceManager()->get('config');
     $tmpDir = isset($config['potool']['tmp_dir']) ? $config['potool']['tmp_dir'] : '/tmp';
     $file = tempnam($tmpDir, 'po_');
     $store = new ArrayStore();
     $parser = new Parser($store);
     $parser->readFile(__DIR__ . '/../../../data/Module1/language/ru_RU.po');
     $this->assertGreaterThan(0, count($store->read()));
     //        $content1 = file_get_contents(__DIR__ . '/../../../data/Module1/language/ru_RU.po');
     $parser->writeFile($file);
     file_put_contents("/tmp/store.php", var_export($store->read(), true));
     $this->assertFileExists($file);
     $this->assertGreaterThan(0, filesize($file));
     //        $content2 = file_get_contents($file);
     unlink($file);
     //        $this->assertSame($content1, $content2);
 }
示例#2
0
 function setUp()
 {
     $config = Bootstrap::getServiceManager()->get('config');
     $this->moduleManager = new ModuleManager($config['potool']);
     $this->testModulesRoot = __DIR__ . '/../../data';
 }
示例#3
0
 function setUp()
 {
     $config = Bootstrap::getServiceManager()->get('config');
     $this->moduleManager = new ModuleManager($config['potool']);
 }