Skip to content

Commit

Permalink
Remove deprecated method usage in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Dec 22, 2016
1 parent 9df5f57 commit 440e53a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions tests/TestCase/View/CellTest.php
Expand Up @@ -18,6 +18,7 @@
use Cake\Core\Configure;
use Cake\Core\Plugin;
use Cake\TestSuite\TestCase;
use Cake\View\View;
use TestApp\View\CustomJsonView;

/**
Expand All @@ -28,6 +29,11 @@
class CellTest extends TestCase
{

/**
* @var \Cake\View\View
*/
public $View;

/**
* setUp method
*
Expand All @@ -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);
}

/**
Expand Down Expand Up @@ -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());
}

/**
Expand All @@ -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());
}

/**
Expand All @@ -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());
}

/**
Expand Down Expand Up @@ -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());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/View/Form/EntityContextTest.php
Expand Up @@ -156,7 +156,7 @@ public function testIsCreateCollection($collection)
*/
public function testInvalidTable()
{
$row = new \StdClass();
$row = new \stdClass();
$context = new EntityContext($this->request, [
'entity' => $row,
]);
Expand Down

0 comments on commit 440e53a

Please sign in to comment.