Skip to content

Instantly share code, notes, and snippets.

@mergeweb
Created June 16, 2016 14:02
Embed
What would you like to do?
<?php
public function testViewAuthenticated()
{
$this->session([
'Auth' => [
'User' => [
'permissions' => [
[
'label' => 'ViewInvoices'
]
],
'roles' => []
]
]
]);
$invoicesController =
$this->getMockBuilder('App\Controller\Account\InvoicesController')
->setMethods($this->_getMethodsExcluding(['isAuthorized', '__construct', 'initialize']))
->getMock();
$invoicesController->expects($this->once())
->method('view');
$this->get('account/invoices/view/1');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment