-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Zend Framework v1.21 integration test #1944
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
public/error.log |
68 changes: 68 additions & 0 deletions
68
tests/Frameworks/ZendFramework/Version_1_21/.zfproject.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0"?> | ||
<projectProfile type="default" version="1.21.4"> | ||
<projectDirectory> | ||
<projectProfileFile filesystemName=".zfproject.xml"/> | ||
<applicationDirectory classNamePrefix="Application_"> | ||
<configsDirectory> | ||
<applicationConfigFile type="ini"/> | ||
</configsDirectory> | ||
<controllersDirectory> | ||
<controllerFile controllerName="Index"> | ||
<actionMethod actionName="index"/> | ||
</controllerFile> | ||
<controllerFile controllerName="Error"/> | ||
</controllersDirectory> | ||
<formsDirectory enabled="false"/> | ||
<layoutsDirectory enabled="false"/> | ||
<modelsDirectory/> | ||
<modulesDirectory enabled="false"/> | ||
<servicesDirectory enabled="false"/> | ||
<viewsDirectory> | ||
<viewScriptsDirectory> | ||
<viewControllerScriptsDirectory forControllerName="Index"> | ||
<viewScriptFile forActionName="index"/> | ||
</viewControllerScriptsDirectory> | ||
<viewControllerScriptsDirectory forControllerName="Error"> | ||
<viewScriptFile forActionName="error"/> | ||
</viewControllerScriptsDirectory> | ||
</viewScriptsDirectory> | ||
<viewHelpersDirectory/> | ||
<viewFiltersDirectory enabled="false"/> | ||
</viewsDirectory> | ||
<bootstrapFile filesystemName="Bootstrap.php"/> | ||
</applicationDirectory> | ||
<dataDirectory enabled="false"> | ||
<cacheDirectory enabled="false"/> | ||
<searchIndexesDirectory enabled="false"/> | ||
<localesDirectory enabled="false"/> | ||
<logsDirectory enabled="false"/> | ||
<sessionsDirectory enabled="false"/> | ||
<uploadsDirectory enabled="false"/> | ||
</dataDirectory> | ||
<docsDirectory> | ||
<file filesystemName="README.txt"/> | ||
</docsDirectory> | ||
<libraryDirectory> | ||
<zfStandardLibraryDirectory enabled="false"/> | ||
</libraryDirectory> | ||
<publicDirectory> | ||
<publicStylesheetsDirectory enabled="false"/> | ||
<publicScriptsDirectory enabled="false"/> | ||
<publicImagesDirectory enabled="false"/> | ||
<publicIndexFile filesystemName="index.php"/> | ||
<htaccessFile filesystemName=".htaccess"/> | ||
</publicDirectory> | ||
<projectProvidersDirectory enabled="false"/> | ||
<temporaryDirectory enabled="false"/> | ||
<testsDirectory> | ||
<testPHPUnitConfigFile filesystemName="phpunit.xml"/> | ||
<testPHPUnitBootstrapFile filesystemName="bootstrap.php"/> | ||
<testApplicationDirectory> | ||
<testApplicationControllerDirectory> | ||
<testApplicationControllerFile forControllerName="Index"/> | ||
</testApplicationControllerDirectory> | ||
</testApplicationDirectory> | ||
<testLibraryDirectory/> | ||
</testsDirectory> | ||
</projectDirectory> | ||
</projectProfile> |
18 changes: 18 additions & 0 deletions
18
tests/Frameworks/ZendFramework/Version_1_21/application/Bootstrap.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap | ||
{ | ||
protected function _initRoutes() | ||
{ | ||
$router = Zend_Controller_Front::getInstance()->getRouter(); | ||
$router->addRoute( | ||
'my_simple_view_route', | ||
new Zend_Controller_Router_Route( | ||
'simple_view', | ||
[ | ||
'controller' => 'simple', | ||
'action' => 'view' | ||
]) | ||
); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
tests/Frameworks/ZendFramework/Version_1_21/application/configs/application.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[production] | ||
phpSettings.display_startup_errors = 0 | ||
phpSettings.display_errors = 0 | ||
includePaths.library = APPLICATION_PATH "/../library" | ||
bootstrap.path = APPLICATION_PATH "/Bootstrap.php" | ||
bootstrap.class = "Bootstrap" | ||
appnamespace = "Application" | ||
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" | ||
resources.frontController.params.displayExceptions = 0 | ||
|
||
[staging : production] | ||
|
||
[testing : production] | ||
phpSettings.display_startup_errors = 1 | ||
phpSettings.display_errors = 1 | ||
|
||
[development : production] | ||
phpSettings.display_startup_errors = 1 | ||
phpSettings.display_errors = 1 | ||
resources.frontController.params.displayExceptions = 1 |
62 changes: 62 additions & 0 deletions
62
tests/Frameworks/ZendFramework/Version_1_21/application/controllers/ErrorController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
class ErrorController extends Zend_Controller_Action | ||
{ | ||
public function indexAction() | ||
{ | ||
throw new \Exception('Controller error'); | ||
} | ||
|
||
public function errorAction() | ||
{ | ||
$errors = $this->_getParam('error_handler'); | ||
|
||
if (!$errors || !$errors instanceof ArrayObject) { | ||
$this->view->message = 'You have reached the error page'; | ||
return; | ||
} | ||
|
||
switch ($errors->type) { | ||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE: | ||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER: | ||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION: | ||
// 404 error -- controller or action not found | ||
$this->getResponse()->setHttpResponseCode(404); | ||
$priority = Zend_Log::NOTICE; | ||
$this->view->message = 'Page not found'; | ||
break; | ||
default: | ||
// application error | ||
$this->getResponse()->setHttpResponseCode(500); | ||
$priority = Zend_Log::CRIT; | ||
$this->view->message = 'Application error'; | ||
break; | ||
} | ||
|
||
// Log exception, if logger available | ||
if ($log = $this->getLog()) { | ||
$log->log($this->view->message, $priority, $errors->exception); | ||
$log->log('Request Parameters', $priority, $errors->request->getParams()); | ||
} | ||
|
||
// conditionally display exceptions | ||
if ($this->getInvokeArg('displayExceptions') == true) { | ||
$this->view->exception = $errors->exception; | ||
} | ||
|
||
$this->view->request = $errors->request; | ||
} | ||
|
||
public function getLog() | ||
{ | ||
$bootstrap = $this->getInvokeArg('bootstrap'); | ||
if (!$bootstrap->hasResource('Log')) { | ||
return false; | ||
} | ||
$log = $bootstrap->getResource('Log'); | ||
return $log; | ||
} | ||
|
||
|
||
} | ||
|
18 changes: 18 additions & 0 deletions
18
tests/Frameworks/ZendFramework/Version_1_21/application/controllers/IndexController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
class IndexController extends Zend_Controller_Action | ||
{ | ||
|
||
public function init() | ||
{ | ||
/* Initialize action controller here */ | ||
} | ||
|
||
public function indexAction() | ||
{ | ||
// action body | ||
} | ||
|
||
|
||
} | ||
|
16 changes: 16 additions & 0 deletions
16
tests/Frameworks/ZendFramework/Version_1_21/application/controllers/SimpleController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
class SimpleController extends Zend_Controller_Action | ||
{ | ||
public function indexAction() | ||
{ | ||
// Don't auto render this action | ||
$this->_helper->viewRenderer->setNoRender(); | ||
echo 'This is a string.'; | ||
} | ||
|
||
public function viewAction() | ||
{ | ||
// Empty | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/Frameworks/ZendFramework/Version_1_21/application/views/scripts/error/error.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<title>Zend Framework Default Application</title> | ||
</head> | ||
<body> | ||
<h1>An error occurred</h1> | ||
<h2><?php echo $this->message ?></h2> | ||
|
||
<?php if (isset($this->exception)): ?> | ||
|
||
<h3>Exception information:</h3> | ||
<p> | ||
<b>Message:</b> <?php echo $this->exception->getMessage() ?> | ||
</p> | ||
|
||
<h3>Stack trace:</h3> | ||
<pre><?php echo $this->exception->getTraceAsString() ?> | ||
</pre> | ||
|
||
<h3>Request Parameters:</h3> | ||
<pre><?php echo $this->escape(var_export($this->request->getParams(), true)) ?> | ||
</pre> | ||
|
||
<?php endif ?> | ||
|
||
</body> | ||
</html> |
43 changes: 43 additions & 0 deletions
43
tests/Frameworks/ZendFramework/Version_1_21/application/views/scripts/index/index.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<style> | ||
a:link, | ||
a:visited | ||
{ | ||
color: #0398CA; | ||
} | ||
|
||
span#zf-name | ||
{ | ||
color: #91BE3F; | ||
} | ||
|
||
div#welcome | ||
{ | ||
color: #FFFFFF; | ||
background-image: url(http://framework.zend.com/images/bkg_header.jpg); | ||
width: 600px; | ||
height: 400px; | ||
border: 2px solid #444444; | ||
overflow: hidden; | ||
text-align: center; | ||
} | ||
|
||
div#more-information | ||
{ | ||
background-image: url(http://framework.zend.com/images/bkg_body-bottom.gif); | ||
height: 100%; | ||
} | ||
</style> | ||
<div id="welcome"> | ||
<h1>Welcome to the <span id="zf-name">Zend Framework!</span></h1> | ||
|
||
<h3>This is your project's main page</h3> | ||
|
||
<div id="more-information"> | ||
<p><img src="http://framework.zend.com/images/PoweredBy_ZF_4LightBG.png" /></p> | ||
<p> | ||
Helpful Links: <br /> | ||
<a href="http://framework.zend.com/">Zend Framework Website</a> | | ||
<a href="http://framework.zend.com/manual/en/">Zend Framework Manual</a> | ||
</p> | ||
</div> | ||
</div> |
1 change: 1 addition & 0 deletions
1
tests/Frameworks/ZendFramework/Version_1_21/application/views/scripts/simple/view.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>This is a simple view</h1> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add it for 8.0 and 8.1 too, or does that pose problems?