Skip to content

Commit

Permalink
- Clean up mock objects stored in attributes at tearDown().
Browse files Browse the repository at this point in the history
- Make setUp() and tearDown() protected, as they should be.


git-svn-id: http://svn.ez.no/svn/ezcomponents/trunk@11344 bc0e7bdc-f0fc-0310-8ff6-f601c06e1256
  • Loading branch information
sb committed Jan 16, 2010
1 parent 799cef4 commit debef58
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Document/tests/pdf/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ abstract class ezcDocumentPdfTestCase extends ezcTestCase
*/
protected $extension = 'pdf';

public function setUp()
protected function setUp()
{
static $i = 0;
$this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/';
$this->basePath = dirname( __FILE__ ) . '/../files/pdf/';
}

public function tearDown()
protected function tearDown()
{
if ( !$this->hasFailed() )
{
Expand Down
9 changes: 8 additions & 1 deletion Document/tests/pdf/driver_transactions_tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static function suite()
return new PHPUnit_Framework_TestSuite( __CLASS__ );
}

public function setUp()
protected function setUp()
{
parent::setUp();

Expand All @@ -47,6 +47,13 @@ public function setUp()
);
}

protected function tearDown()
{
parent::tearDown();
$this->mock = null;
$this->driver = null;
}

public function testNoIssuedWriteCallsToBackend()
{
$this->mock->expects( $this->never() )->method( 'drawWord' );
Expand Down
3 changes: 3 additions & 0 deletions Graph/tests/renderer_2d_legacy_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ protected function setUp()

protected function tearDown()
{
$this->renderer = null;
$this->driver = null;

if ( !$this->hasFailed() )
{
$this->removeTempDir();
Expand Down
3 changes: 3 additions & 0 deletions Graph/tests/renderer_2d_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ protected function setUp()

protected function tearDown()
{
$this->driver = null;
$this->renderer = null;

if ( !$this->hasFailed() )
{
$this->removeTempDir();
Expand Down
7 changes: 6 additions & 1 deletion Reflection/tests/abstract_type_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ezcReflectionAbstractTypeTest extends ezcTestCase
*/
protected $type;

public function setUp()
protected function setUp()
{
$this->type = $this->getMock(
'ezcReflectionAbstractType',
Expand All @@ -24,6 +24,11 @@ public function setUp()
);
}

protected function tearDown()
{
$this->type = null;
}

public function testGetTypeName()
{
self::assertEquals( 'string', $this->type->getTypeName() );
Expand Down

0 comments on commit debef58

Please sign in to comment.