Skip to content

Commit

Permalink
Fix deprecated method usage in Helpers.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 16, 2017
1 parent 6dcf7cd commit 7f4245e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/View/Helper/FlashHelper.php
Expand Up @@ -74,7 +74,7 @@ public function render($key = 'flash', array $options = [])
return null;
}

$flash = $this->request->session()->read("Flash.$key");
$flash = $this->request->getSession()->read("Flash.$key");
if (!is_array($flash)) {
throw new UnexpectedValueException(sprintf(
'Value for flash setting key "%s" must be an array.',
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/View/Helper/FlashHelperTest.php
Expand Up @@ -143,7 +143,7 @@ public function testFlash()
public function testFlashThrowsException()
{
$this->expectException(\UnexpectedValueException::class);
$this->View->request->session()->write('Flash.foo', 'bar');
$this->View->request->getSession()->write('Flash.foo', 'bar');
$this->Flash->render('foo');
}

Expand Down Expand Up @@ -217,7 +217,7 @@ public function testFlashWithStack()
['div' => ['id' => 'classy-message']], 'Recorded', '/div'
];
$this->assertHtml($expected, $result);
$this->assertNull($this->View->request->session()->read('Flash.stack'));
$this->assertNull($this->View->request->getSession()->read('Flash.stack'));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/View/Helper/PaginatorHelperTest.php
Expand Up @@ -446,7 +446,7 @@ public function testSortLinksMultiplePagination()
]);

$this->Paginator->options(['model' => 'Articles']);
$this->Paginator->request['paging'] = [
$this->Paginator->request = $this->Paginator->request->withParam('paging', [
'Articles' => [
'current' => 9,
'count' => 62,
Expand All @@ -469,7 +469,7 @@ public function testSortLinksMultiplePagination()
'page' => 1,
'scope' => 'tags',
]
];
]);

$result = $this->Paginator->sort('title', 'Title', ['model' => 'Articles']);
$expected = [
Expand Down

0 comments on commit 7f4245e

Please sign in to comment.