PHP code example of besanek / presenter-tester
1. Go to this page and download the library: Download besanek/presenter-tester library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
besanek / presenter-tester example snippets
$tester = new PresenterTester($container->getByType('\Nette\Application\IPresenterFactory'));
$tester->setPresenter('Homepage');
$response = $tester->run();
$tester = new PresenterTester($container->getByType('\Nette\Application\IPresenterFactory'));
$tester->setPresenter('Article');
$tester->setAction('edit');
$tester->setHandle('form-save')
$tester->setParams(array('id' => 1));
$article = array(
'content' => 'Lorem ipsum',
'save' => 'save',
);
$tester->setPost($article);
$response = $tester->run();