From 440e53a54fc02fcfa14447c1e9bd63edfa03f69b Mon Sep 17 00:00:00 2001 From: dereuromark Date: Thu, 24 Nov 2016 01:55:21 +0100 Subject: [PATCH] Remove deprecated method usage in tests. --- tests/TestCase/View/CellTest.php | 18 ++++++++++++------ tests/TestCase/View/Form/EntityContextTest.php | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/TestCase/View/CellTest.php b/tests/TestCase/View/CellTest.php index 5f52c325817..ec24bb63d30 100644 --- a/tests/TestCase/View/CellTest.php +++ b/tests/TestCase/View/CellTest.php @@ -18,6 +18,7 @@ use Cake\Core\Configure; use Cake\Core\Plugin; use Cake\TestSuite\TestCase; +use Cake\View\View; use TestApp\View\CustomJsonView; /** @@ -28,6 +29,11 @@ class CellTest extends TestCase { + /** + * @var \Cake\View\View + */ + public $View; + /** * setUp method * @@ -40,7 +46,7 @@ public function setUp() Plugin::load(['TestPlugin', 'TestTheme']); $request = $this->getMockBuilder('Cake\Network\Request')->getMock(); $response = $this->getMockBuilder('Cake\Network\Response')->getMock(); - $this->View = new \Cake\View\View($request, $response); + $this->View = new View($request, $response); } /** @@ -139,7 +145,7 @@ public function testSettingCellTemplateFromAction() $this->assertContains('This is the alternate template', "{$appCell}"); $this->assertEquals('alternate_teaser_list', $appCell->template); - $this->assertEquals('alternate_teaser_list', $appCell->viewBuilder()->template()); + $this->assertEquals('alternate_teaser_list', $appCell->viewBuilder()->getTemplate()); } /** @@ -153,7 +159,7 @@ public function testSettingCellTemplatePathFromAction() $this->assertContains('Articles subdir custom_template_path template', "{$appCell}"); $this->assertEquals('custom_template_path', $appCell->template); - $this->assertEquals('Cell/Articles/Subdir', $appCell->viewBuilder()->templatePath()); + $this->assertEquals('Cell/Articles/Subdir', $appCell->viewBuilder()->getTemplatePath()); } /** @@ -166,7 +172,7 @@ public function testSettingCellTemplateFromActionViewBuilder() $appCell = $this->View->cell('Articles::customTemplateViewBuilder'); $this->assertContains('This is the alternate template', "{$appCell}"); - $this->assertEquals('alternate_teaser_list', $appCell->viewBuilder()->template()); + $this->assertEquals('alternate_teaser_list', $appCell->viewBuilder()->getTemplate()); } /** @@ -205,9 +211,9 @@ public function testCellRenderThemed() $this->View->theme = 'TestTheme'; $cell = $this->View->cell('Articles', ['msg' => 'hello world!']); - $this->assertEquals($this->View->theme, $cell->viewBuilder()->theme()); + $this->assertEquals($this->View->theme, $cell->viewBuilder()->getTheme()); $this->assertContains('Themed cell content.', $cell->render()); - $this->assertEquals($cell->View->theme, $cell->viewBuilder()->theme()); + $this->assertEquals($cell->View->theme, $cell->viewBuilder()->getTheme()); } /** diff --git a/tests/TestCase/View/Form/EntityContextTest.php b/tests/TestCase/View/Form/EntityContextTest.php index acd45069ba3..231504a7e70 100644 --- a/tests/TestCase/View/Form/EntityContextTest.php +++ b/tests/TestCase/View/Form/EntityContextTest.php @@ -156,7 +156,7 @@ public function testIsCreateCollection($collection) */ public function testInvalidTable() { - $row = new \StdClass(); + $row = new \stdClass(); $context = new EntityContext($this->request, [ 'entity' => $row, ]);