$object->size = filesize(dirname(__FILE__) . '/../files/tine_logo_setup.png'); Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' change file object ' . $object->hash); $testObject = $this->_backend->update($object); $object->hash = hash_file('sha1', dirname(__FILE__) . '/../files/tine_logo.png'); $object->size = filesize(dirname(__FILE__) . '/../files/tine_logo.png'); Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' change file object ' . $object->hash); $testObject = $this->_backend->update($object); } } $time_end = microtime(true); $time = $time_end - $time_start; echo "TIME: {$time}" . PHP_EOL; Tinebase_TransactionManager::getInstance()->commitTransaction($transactionId); $time_start = microtime(true); $testObject = $this->_backend->get($object); $time_end = microtime(true); $time = $time_end - $time_start; echo "TIME: {$time}" . PHP_EOL; } /** * @return Filemanager_Model_Directory */ public static function getTestRecord() { $object = new Tinebase_Model_Tree_FileObject(array('type' => Tinebase_Model_Tree_FileObject::TYPE_FILE, 'creation_time' => Tinebase_DateTime::now(), 'created_by' => Tinebase_Core::getUser()->getId(), 'hash' => hash_file('sha1', dirname(__FILE__) . '/../files/tine_logo.png'), 'size' => filesize(dirname(__FILE__) . '/../files/tine_logo.png'))); return $object; } } if (PHPUnit_MAIN_METHOD == 'Tinebase_Tree_FileObjectTest::main') { Tinebase_Tree_FileObjectTest::main(); }