[TYPO3-caretaker] Help setting up a Test with caretaker_instance

Martin Ficzel martin.ficzel at gmx.de
Thu Jun 10 16:09:42 CEST 2010


Am 09.06.10 14:51, schrieb Volker Biberger:
> Hi Group,
>
> I played around with caretaker and am very exited with it's possibilities.
>
> Now I have no idea how to create a Test that connects to a
> caretaker_instance. For a start I would be happy to test the
> TYPO3Version. I am however not shure how to implement the test itself.
> What would be a good start to learn to write tests for caretaker that
> connect to other servers?

Hello Volker,

there are also some informations in the wiki at 
http://forge.typo3.org/projects/extension-caretaker/wiki/Manual_extendability which are 
incomplete an probably outdated.

The best way is to look into the test-service which are implemented in the 
caretaker_instance extension in path services. The test-services are running on the 
caretaker-server and are calling the remote-operations on caretaker instance.

Best way ist to start by implementing your own test-service which first returns a 
predefiened result. You have to add a class and a flexform for your test-service and 
register it for the caretaker extension in ext_localconf.php and ext_tables.php .

> // Register Caretaker Services
> if (t3lib_extMgm::isLoaded('caretaker') ){
> 	include_once(t3lib_extMgm::extPath('caretaker') . 'classes/helpers/class.tx_caretaker_ServiceHelper.php');
> 	tx_caretaker_ServiceHelper::registerCaretakerService($_EXTKEY, 'services', 'tx_caretakerinstance_TYPO3Version',  'TYPO3 -> Version', 'Check for the TYPO3 version');
> }

If this is done you already mastered the creation and registering of a test-service on the 
caretaker Server.

The second step is to call the remote Operation on the instance.

> $operation = array('GetTYPO3Version');
> $operations = array($operation);
> 		
> $commandResult = $this->executeRemoteOperations($operations);
> if (!$this->isCommandResultSuccessful($commandResult)) {
> 	return $this->getFailedCommandResultTestResult($commandResult);
> }
> 		
> $results = $commandResult->getOperationResults();

I hope this helps.

Regards, Martin




More information about the TYPO3-project-caretaker mailing list