CakeDC\Users\Test\TestCase\Controller\Traits\LoginTraitTest::testLogout PHP Метод

testLogout() публичный Метод

test
public testLogout ( ) : void
Результат void
    public function testLogout()
    {
        $this->_mockDispatchEvent(new Event('event'));
        $this->Trait->Auth = $this->getMockBuilder('Cake\\Controller\\Component\\AuthComponent')->setMethods(['logout'])->disableOriginalConstructor()->getMock();
        $redirectLogoutOK = '/';
        $this->Trait->Auth->expects($this->once())->method('logout')->will($this->returnValue($redirectLogoutOK));
        $this->Trait->expects($this->once())->method('redirect')->with($redirectLogoutOK);
        $this->Trait->Flash = $this->getMockBuilder('Cake\\Controller\\Component\\FlashComponent')->setMethods(['success'])->disableOriginalConstructor()->getMock();
        $this->Trait->Flash->expects($this->once())->method('success')->with('You\'ve successfully logged out');
        $this->Trait->logout();
    }