Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
104 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
/** | ||
* @see Zend_Test_PHPUnit_ControllerTestCase | ||
*/ | ||
require_once 'Zend/Test/PHPUnit/ControllerTestCase.php'; | ||
|
||
abstract class ControllerTestCase extends Zend_Test_PHPUnit_ControllerTestCase | ||
{ | ||
public function setUp() | ||
{ | ||
$this->bootstrap = new Zend_Application( | ||
APPLICATION_ENV, | ||
APPLICATION_PATH . '/configs/application.ini' | ||
); | ||
|
||
parent::setUp(); | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
error_reporting(E_ALL | E_STRICT); | ||
|
||
// Define path to application directory | ||
defined('APPLICATION_PATH') | ||
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application')); | ||
|
||
// Define application environment | ||
defined('APPLICATION_ENV') | ||
|| define('APPLICATION_ENV', 'testing'); | ||
|
||
// Ensure library/ is on include_path | ||
set_include_path(implode(PATH_SEPARATOR, array( | ||
realpath(APPLICATION_PATH . '/../library'), | ||
get_include_path(), | ||
))); | ||
|
||
//require_once 'Zend/Loader.php'; | ||
//Zend_Loader::registerAutoload(); | ||
|
||
/** | ||
* @see Zend_Application | ||
*/ | ||
require_once 'Zend/Application.php'; | ||
|
||
require_once 'ControllerTestCase.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,15 @@ | ||
<?php | ||
|
||
require_once realpath(dirname(__FILE__) . '/../bootstrap.php'); | ||
|
||
class ErrorControllerTest extends ControllerTestCase | ||
{ | ||
public function testErrorUrl() | ||
{ | ||
$this->dispatch('foo'); | ||
$this->assertModule('default'); | ||
$this->assertController('error'); | ||
$this->assertAction('error'); | ||
$this->assertResponseCode(404); | ||
} | ||
} |
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,14 @@ | ||
<?php | ||
|
||
require_once realpath(dirname(__FILE__) . '/../bootstrap.php'); | ||
|
||
class IndexControllerTest extends ControllerTestCase | ||
{ | ||
public function testIndexAction() | ||
{ | ||
$this->dispatch('/'); | ||
$this->assertModule('default'); | ||
$this->assertController('index'); | ||
$this->assertAction('index'); | ||
} | ||
} |
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,30 @@ | ||
<phpunit bootstrap="./application/bootstrap.php" | ||
colors="true" | ||
stopOnFailure="true"> | ||
|
||
<testsuite name="Main Test Suite"> | ||
<directory>./</directory> | ||
</testsuite> | ||
|
||
<filter> | ||
<blacklist> | ||
<directory suffix=".php">/usr/share/php</directory> | ||
<directory suffix=".php">../tests</directory> | ||
</blacklist> | ||
<whitelist> | ||
<directory suffix=".php">../library/</directory> | ||
<directory suffix=".php">../application/</directory> | ||
<exclude> | ||
<directory suffix=".phtml">../application/</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
|
||
<!-- <logging> | ||
<log type="coverage-html" target="./log/report" charset="UTF-8" | ||
yui="true" highlight="true" | ||
lowUpperBound="50" highLowerBound="80"/> | ||
<log type="testdox-html" target="./log/testdox.html" /> | ||
</logging> --> | ||
|
||
</phpunit> |