示例#1
0
 public function testConcatPath()
 {
     $result = Util::fixPath('dir1/dir2/file1.json');
     $this->assertEquals($result, Util::concatPath('dir1/dir2', 'file1.json'));
     $result = Util::fixPath('dir1/dir2/file1.json');
     $this->assertEquals($result, Util::concatPath('dir1/dir2/', 'file1.json'));
     $result = Util::fixPath('dir1/dir2/file1.json');
     $this->assertEquals($result, Util::concatPath('dir1/dir2/file1.json'));
     $input = array('dir1/dir2', 'file1.json');
     $result = Util::fixPath('dir1/dir2/file1.json');
     $this->assertEquals($result, Util::concatPath($input));
     $input = array('dir1/', 'dir2', 'file1.json');
     $result = Util::fixPath('dir1/dir2/file1.json');
     $this->assertEquals($result, Util::concatPath($input));
 }
示例#2
0
 function testGetLayoutPathModule()
 {
     $this->objects['metadata']->expects($this->exactly(1))->method('getScopeModuleName')->will($this->returnValue('Crm'));
     $this->assertEquals(Util::fixPath('application/Espo/Modules/Crm/Resources/layouts/Call'), $this->reflection->invokeMethod('getLayoutPath', array('Call')));
     $this->assertEquals(Util::fixPath('custom/Espo/Custom/Resources/layouts/Call'), $this->reflection->invokeMethod('getLayoutPath', array('Call', true)));
 }
示例#3
0
 public function testGetPath()
 {
     $packageId = $this->reflection->invokeMethod('getProcessId');
     $packagePath = Util::fixPath($this->actionManagerParams['packagePath'] . '/' . $packageId);
     $this->assertEquals($packagePath, $this->reflection->invokeMethod('getPath', array()));
     $this->assertEquals($packagePath, $this->reflection->invokeMethod('getPath', array('packagePath')));
     $postfix = $this->reflection->getProperty('packagePostfix');
     $this->assertEquals($packagePath . $postfix, $this->reflection->invokeMethod('getPath', array('packagePath', true)));
     $backupPath = Util::fixPath($this->actionManagerParams['backupPath'] . '/' . $packageId);
     $this->assertEquals($backupPath, $this->reflection->invokeMethod('getPath', array('backupPath')));
 }
示例#4
0
 public function testGetRootDir()
 {
     $rootDir = dirname(__FILE__);
     $rootDir = str_replace(Util::fixPath('/tests/Espo/Core/Utils'), '', $rootDir);
     $this->assertEquals($rootDir, $this->object->getRootDir());
 }
示例#5
0
 public function testGetSingeFileListOnlyFiles()
 {
     $input = array('custom' => array('Espo' => array('Custom' => array('Modules' => array('ExtensionTest' => array(0 => 'File.json', 1 => 'File.php'))))));
     $result = array(Util::fixPath('custom/Espo/Custom/Modules/ExtensionTest/File.json'), Util::fixPath('custom/Espo/Custom/Modules/ExtensionTest/File.php'));
     $this->assertEquals($result, $this->reflection->invokeMethod('getSingeFileList', array($input, true)));
 }