Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Factor out common code from BankAccountViewTest and BankAccountListVi…

…ewTest into ViewTestCase.
  • Loading branch information...
commit 796945431165ae37a8beee9fb45af5d29db50b40 1 parent 2fdf829
@sebastianbergmann sebastianbergmann authored
View
1  tests/autoload.php
@@ -24,6 +24,7 @@ function($class) {
'testview' => '/unit/framework/fixture/TestView.php',
'viewfactorytest' => '/unit/framework/ViewFactoryTest.php',
'viewtest' => '/unit/framework/ViewTest.php',
+ 'viewtestcase' => '/unit/ViewTestCase.php',
'webtest' => '/system/WebTest.php'
);
}
View
17 tests/unit/ViewTestCase.php
@@ -0,0 +1,17 @@
+<?php
+abstract class ViewTestCase extends PHPUnit_Framework_TestCase
+{
+ protected $request;
+ protected $response;
+
+ protected function setUp()
+ {
+ $this->request = $this->getMockBuilder('Request')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $this->response = $this->getMockBuilder('Response')
+ ->disableOriginalConstructor()
+ ->getMock();
+ }
+}
View
16 tests/unit/view/BankAccountListViewTest.php
@@ -2,22 +2,8 @@
/**
* @small
*/
-class BankAccountListViewTest extends PHPUnit_Framework_TestCase
+class BankAccountListViewTest extends ViewTestCase
{
- protected $request;
- protected $response;
-
- protected function setUp()
- {
- $this->request = $this->getMockBuilder('Request')
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->response = $this->getMockBuilder('Response')
- ->disableOriginalConstructor()
- ->getMock();
- }
-
/**
* @covers BankAccountListView::render
*/
View
16 tests/unit/view/BankAccountViewTest.php
@@ -2,22 +2,8 @@
/**
* @small
*/
-class BankAccountViewTest extends PHPUnit_Framework_TestCase
+class BankAccountViewTest extends ViewTestCase
{
- protected $request;
- protected $response;
-
- protected function setUp()
- {
- $this->request = $this->getMockBuilder('Request')
- ->disableOriginalConstructor()
- ->getMock();
-
- $this->response = $this->getMockBuilder('Response')
- ->disableOriginalConstructor()
- ->getMock();
- }
-
/**
* @covers BankAccountView::render
*/
Please sign in to comment.
Something went wrong with that request. Please try again.