Skip to content
Permalink
Browse files

Remove deprecated method usage in tests.

  • Loading branch information...
dereuromark committed Nov 24, 2016
1 parent 9df5f57 commit 440e53a54fc02fcfa14447c1e9bd63edfa03f69b
Showing with 13 additions and 7 deletions.
  1. +12 −6 tests/TestCase/View/CellTest.php
  2. +1 −1 tests/TestCase/View/Form/EntityContextTest.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());
}
/**
@@ -156,7 +156,7 @@ public function testIsCreateCollection($collection)
*/
public function testInvalidTable()
{
$row = new \StdClass();
$row = new \stdClass();
$context = new EntityContext($this->request, [
'entity' => $row,
]);

0 comments on commit 440e53a

Please sign in to comment.
You can’t perform that action at this time.