mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fix casing of vars in tests.
This commit is contained in:
parent
b20803bb6f
commit
c64e41eb45
1 changed files with 14 additions and 14 deletions
|
@ -35,16 +35,16 @@ class JsonViewTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testRenderWithoutView() {
|
||||
$request = new CakeRequest();
|
||||
$response = new CakeResponse();
|
||||
$controller = new Controller($request, $response);
|
||||
$Request = new CakeRequest();
|
||||
$Response = new CakeResponse();
|
||||
$Controller = new Controller($Request, $Response);
|
||||
$data = array('user' => 'fake', 'list' => array('item1', 'item2'));
|
||||
$controller->set('serialize', $data);
|
||||
$view = new JsonView($controller);
|
||||
$output = $view->render(false);
|
||||
$Controller->set(array('data' => $data, 'serialize' => 'data'));
|
||||
$View = new JsonView($Controller);
|
||||
$output = $View->render(false);
|
||||
|
||||
$this->assertIdentical(json_encode($data), $output);
|
||||
$this->assertIdentical('application/json', $response->type());
|
||||
$this->assertIdentical('application/json', $Response->type());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,9 +54,9 @@ class JsonViewTest extends CakeTestCase {
|
|||
*/
|
||||
public function testRenderWithView() {
|
||||
App::build(array('View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Json')));
|
||||
$request = new CakeRequest();
|
||||
$response = new CakeResponse();
|
||||
$controller = new Controller($request, $response);
|
||||
$Request = new CakeRequest();
|
||||
$Response = new CakeResponse();
|
||||
$Controller = new Controller($Request, $Response);
|
||||
$data = array(
|
||||
'User' => array(
|
||||
'username' => 'fake'
|
||||
|
@ -66,13 +66,13 @@ class JsonViewTest extends CakeTestCase {
|
|||
array('name' => 'item2')
|
||||
)
|
||||
);
|
||||
$controller->set('user', $data);
|
||||
$view = new JsonView($controller);
|
||||
$output = $view->render('index');
|
||||
$Controller->set('user', $data);
|
||||
$View = new JsonView($Controller);
|
||||
$output = $View->render('index');
|
||||
|
||||
$expected = json_encode(array('user' => 'fake', 'list' => array('item1', 'item2')));
|
||||
$this->assertIdentical($expected, $output);
|
||||
$this->assertIdentical('application/json', $response->type());
|
||||
$this->assertIdentical('application/json', $Response->type());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue