Skip to content

Instantly share code, notes, and snippets.

@mergeweb
Created June 16, 2016 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mergeweb/6bb0fc75b28d777a702362afa9fba81b to your computer and use it in GitHub Desktop.
Save mergeweb/6bb0fc75b28d777a702362afa9fba81b to your computer and use it in GitHub Desktop.
<?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