私はこれを解決することはできません。
$this->_request->setBasePath('http://localhost/');
$this->_request->setModuleKey('admin');
$this->_request->setControllerKey('controller-page');
$this->_request->setActionKey('index');
$this->_sslRedirect->preDispatch($this->_request);
$this->assertRedirectRegex('/https:/');
私のコントローラープラグインでは、 preDispatch() は SSL へのリダイレクトを行う場合と行わない場合があります。これはブラウザで機能しますが、テストを書くことができません。テストは次のように失敗します。
Failed asserting response redirects to URL MATCHING "/https:/"
/srv/app/zend/library/Zend/Test/PHPUnit/Constraint/Redirect.php:190
/srv/app/zend/library/Zend/Test/PHPUnit/ControllerTestCase.php:764
/srv/app/www/tests/lib/Saffron/Controller/Plugin/SslRedirectTest.php:36
/usr/bin/phpunit:46
Zend_Test_PHPUnit_ControllerTestCase 内の preDispatch() 行の直後に $this->dispatch() を試してみましたが、何らかの理由でエラー 404 Not Found が発生しました...
何か案は?