From fc2ad505bece5a666631bf42a03ca9d9175e228c Mon Sep 17 00:00:00 2001 From: Stepan Tanasiychuk Date: Thu, 2 Dec 2010 16:37:35 +0200 Subject: [PATCH] set up test environment --- tests/application/ControllerTestCase.php | 19 ++++++++++++ tests/application/bootstrap.php | 26 ++++++++++++++++ .../controllers/ErrorControllerTest.php | 15 ++++++++++ .../controllers/IndexControllerTest.php | 14 +++++++++ tests/phpunit.xml | 30 +++++++++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 tests/application/ControllerTestCase.php create mode 100644 tests/application/controllers/ErrorControllerTest.php create mode 100644 tests/application/controllers/IndexControllerTest.php diff --git a/tests/application/ControllerTestCase.php b/tests/application/ControllerTestCase.php new file mode 100644 index 0000000..ec2a246 --- /dev/null +++ b/tests/application/ControllerTestCase.php @@ -0,0 +1,19 @@ +bootstrap = new Zend_Application( + APPLICATION_ENV, + APPLICATION_PATH . '/configs/application.ini' + ); + + parent::setUp(); + } +} diff --git a/tests/application/bootstrap.php b/tests/application/bootstrap.php index e69de29..1b41b7d 100644 --- a/tests/application/bootstrap.php +++ b/tests/application/bootstrap.php @@ -0,0 +1,26 @@ +dispatch('foo'); + $this->assertModule('default'); + $this->assertController('error'); + $this->assertAction('error'); + $this->assertResponseCode(404); + } +} \ No newline at end of file diff --git a/tests/application/controllers/IndexControllerTest.php b/tests/application/controllers/IndexControllerTest.php new file mode 100644 index 0000000..508132c --- /dev/null +++ b/tests/application/controllers/IndexControllerTest.php @@ -0,0 +1,14 @@ +dispatch('/'); + $this->assertModule('default'); + $this->assertController('index'); + $this->assertAction('index'); + } +} \ No newline at end of file diff --git a/tests/phpunit.xml b/tests/phpunit.xml index e69de29..b2b7963 100644 --- a/tests/phpunit.xml +++ b/tests/phpunit.xml @@ -0,0 +1,30 @@ + + + + ./ + + + + + /usr/share/php + ../tests + + + ../library/ + ../application/ + + ../application/ + + + + + + +