123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- class sfTestFunctional extends sfTestFunctionalBase
- {
-
- public function __construct(sfBrowserBase $browser, lime_test $lime = null, $testers = array())
- {
- $testers = array_merge(array(
- 'view_cache' => 'sfTesterViewCache',
- 'form' => 'sfTesterForm',
- ), $testers);
- parent::__construct($browser, $lime, $testers);
- }
-
- public function isForwardedTo($moduleName, $actionName, $position = 'last')
- {
- $actionStack = $this->browser->getContext()->getActionStack();
- switch ($position)
- {
- case 'first':
- $entry = $actionStack->getFirstEntry();
- break;
- case 'last':
- $entry = $actionStack->getLastEntry();
- break;
- default:
- $entry = $actionStack->getEntry($position);
- }
- $this->test()->is($entry->getModuleName(), $moduleName, sprintf('request is forwarded to the "%s" module (%s)', $moduleName, $position));
- $this->test()->is($entry->getActionName(), $actionName, sprintf('request is forwarded to the "%s" action (%s)', $actionName, $position));
- return $this;
- }
-
- public function isCached($boolean, $with_layout = false)
- {
- return $this->with('view_cache')->isCached($boolean, $with_layout);
- }
-
- public function isUriCached($uri, $boolean, $with_layout = false)
- {
- return $this->with('view_cache')->isUriCached($uri, $boolean, $with_layout);
- }
- }
|