From d2f4a921a9de0b0c93b300e76535f374d206c1e0 Mon Sep 17 00:00:00 2001 From: Kore Nordmann Date: Sat, 21 Dec 2013 11:53:29 +0100 Subject: Updated to changes in PHPUnit Mock API --- tests/renderer_2d_test.php | 24 +++++++++++--------- tests/renderer_3d_test.php | 56 +++++++++++++++++++++++++++++----------------- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/tests/renderer_2d_test.php b/tests/renderer_2d_test.php index e684cfd..2f3f1a9 100644 --- a/tests/renderer_2d_test.php +++ b/tests/renderer_2d_test.php @@ -63,19 +63,21 @@ class ezcGraphRenderer2dTest extends ezcGraphTestCase $this->renderer = new ezcGraphRenderer2d(); - $this->driver = $this->getMock( 'ezcGraphSvgDriver', array( - 'drawPolygon', - 'drawLine', - 'drawTextBox', - 'drawCircleSector', - 'drawCircularArc', - 'drawCircle', - 'drawImage', - ) ); + $this->driver = $this->getMockBuilder( 'ezcGraphSvgDriver' ) + ->enableArgumentCloning() + ->setMethods( array( + 'drawPolygon', + 'drawLine', + 'drawTextBox', + 'drawCircleSector', + 'drawCircularArc', + 'drawCircle', + 'drawImage', + ) )->getMock(); $this->renderer->setDriver( $this->driver ); - $this->driver->options->width = 400; - $this->driver->options->height = 200; + $this->driver->options->width= 400; + $this->driver->options->height= 200; } public function tearDown() diff --git a/tests/renderer_3d_test.php b/tests/renderer_3d_test.php index cf5dcd7..36630a4 100644 --- a/tests/renderer_3d_test.php +++ b/tests/renderer_3d_test.php @@ -69,9 +69,11 @@ class ezcGraphRenderer3dTest extends ezcGraphTestCase public function testRenderBackgroundImage() { - $driver = $this->getMock( 'ezcGraphSvgDriver', array( - 'drawImage', - ) ); + $driver = $this->getMockBuilder( 'ezcGraphSvgDriver' ) + ->enableArgumentCloning() + ->setMethods( array( + 'drawImage', + ) )->getMock(); $driver->options->width = 400; $driver->options->height = 200; @@ -96,9 +98,11 @@ class ezcGraphRenderer3dTest extends ezcGraphTestCase public function testRenderTopLeftBackgroundImage() { - $driver = $this->getMock( 'ezcGraphSvgDriver', array( - 'drawImage', - ) ); + $driver = $this->getMockBuilder( 'ezcGraphSvgDriver' ) + ->enableArgumentCloning() + ->setMethods( array( + 'drawImage', + ) )->getMock(); $driver->options->width = 400; $driver->options->height = 200; @@ -124,9 +128,11 @@ class ezcGraphRenderer3dTest extends ezcGraphTestCase public function testRenderBottomRightBackgroundImage() { - $driver = $this->getMock( 'ezcGraphSvgDriver', array( - 'drawImage', - ) ); + $driver = $this->getMockBuilder( 'ezcGraphSvgDriver' ) + ->enableArgumentCloning() + ->setMethods( array( + 'drawImage', + ) )->getMock(); $driver->options->width = 400; $driver->options->height = 200; @@ -152,9 +158,11 @@ class ezcGraphRenderer3dTest extends ezcGraphTestCase public function testRenderToBigBackgroundImage() { - $driver = $this->getMock( 'ezcGraphSvgDriver', array( - 'drawImage', - ) ); + $driver = $this->getMockBuilder( 'ezcGraphSvgDriver' ) + ->enableArgumentCloning() + ->setMethods( array( + 'drawImage', + ) )->getMock(); $driver->options->width = 400; $driver->options->height = 200; @@ -180,9 +188,11 @@ class ezcGraphRenderer3dTest extends ezcGraphTestCase public function testRenderBackgroundImageRepeatX() { - $driver = $this->getMock( 'ezcGraphSvgDriver', array( - 'drawImage', - ) ); + $driver = $this->getMockBuilder( 'ezcGraphSvgDriver' ) + ->enableArgumentCloning() + ->setMethods( array( + 'drawImage', + ) )->getMock(); $driver->options->width = 400; $driver->options->height = 200; @@ -227,9 +237,11 @@ class ezcGraphRenderer3dTest extends ezcGraphTestCase public function testRenderBackgroundImageRepeatY() { - $driver = $this->getMock( 'ezcGraphSvgDriver', array( - 'drawImage', - ) ); + $driver = $this->getMockBuilder( 'ezcGraphSvgDriver' ) + ->enableArgumentCloning() + ->setMethods( array( + 'drawImage', + ) )->getMock(); $driver->options->width = 400; $driver->options->height = 200; @@ -265,9 +277,11 @@ class ezcGraphRenderer3dTest extends ezcGraphTestCase public function testRenderBackgroundImageRepeatBoth() { - $driver = $this->getMock( 'ezcGraphSvgDriver', array( - 'drawImage', - ) ); + $driver = $this->getMockBuilder( 'ezcGraphSvgDriver' ) + ->enableArgumentCloning() + ->setMethods( array( + 'drawImage', + ) )->getMock(); $driver->options->width = 400; $driver->options->height = 200; -- cgit v1.1