From cb666c18d6dd6863495b1da5fe979fdc5fa42204 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 6 May 2014 20:25:41 +0200 Subject: rename formatter to responder, formatResponse to buildResponse --- tests/lib/appframework/controller/ControllerTest.php | 10 +++++----- tests/lib/appframework/http/DispatcherTest.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/lib/appframework/controller/ControllerTest.php b/tests/lib/appframework/controller/ControllerTest.php index 4785c686f27..0696d00a425 100644 --- a/tests/lib/appframework/controller/ControllerTest.php +++ b/tests/lib/appframework/controller/ControllerTest.php @@ -38,7 +38,7 @@ class ToUpperCaseSerializer implements IResponseSerializer { class ChildController extends Controller { public function custom($in) { - $this->registerFormatter('json', function ($response) { + $this->registerResponder('json', function ($response) { return new JSONResponse(array(strlen($response))); }); @@ -155,12 +155,12 @@ class ControllerTest extends \PHPUnit_Framework_TestCase { * @expectedException \DomainException */ public function testFormatResonseInvalidFormat() { - $this->controller->formatResponse(null, 'test'); + $this->controller->buildResponse(null, 'test'); } public function testFormat() { - $response = $this->controller->formatResponse(array('hi'), 'json'); + $response = $this->controller->buildResponse(array('hi'), 'json'); $this->assertEquals(array('hi'), $response->getData()); } @@ -168,7 +168,7 @@ class ControllerTest extends \PHPUnit_Framework_TestCase { public function testCustomFormatter() { $response = $this->controller->custom('hi'); - $response = $this->controller->formatResponse($response, 'json'); + $response = $this->controller->buildResponse($response, 'json'); $this->assertEquals(array(2), $response->getData()); } @@ -176,7 +176,7 @@ class ControllerTest extends \PHPUnit_Framework_TestCase { public function testCustomSerializer() { $response = $this->controller->serializer('hi'); - $response = $this->controller->formatResponse($response, 'json'); + $response = $this->controller->buildResponse($response, 'json'); $this->assertEquals(array('HI'), $response->getData()); } diff --git a/tests/lib/appframework/http/DispatcherTest.php b/tests/lib/appframework/http/DispatcherTest.php index d1296f9cf0f..08fb374cfa9 100644 --- a/tests/lib/appframework/http/DispatcherTest.php +++ b/tests/lib/appframework/http/DispatcherTest.php @@ -41,7 +41,7 @@ class TestController extends Controller { * @param bool $bool */ public function exec($int, $bool) { - $this->registerFormatter('text', function($in) { + $this->registerResponder('text', function($in) { return new JSONResponse(array('text' => $in)); }); return array($int, $bool); -- cgit v1.2.3